Skip to content

Commit

Permalink
fix: url count migration
Browse files Browse the repository at this point in the history
  • Loading branch information
vinit717 committed Jun 30, 2024
1 parent ca47bf9 commit b9f1bd8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 0 additions & 1 deletion cmd/bun/migrations/20240215113820_initial-setup.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ CREATE TABLE users (
updated_at timestamp DEFAULT (NOW() AT TIME ZONE 'UTC'),
is_deleted boolean DEFAULT false,
is_onboarding BOOLEAN NOT NULL DEFAULT TRUE
url_count int NOT NULL DEFAULT 0
);

--bun:split
Expand Down
9 changes: 9 additions & 0 deletions cmd/bun/migrations/20240630181359_add_url_count.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
BEGIN;

--bun:split

ALTER TABLE users ADD url_count bool int NOT NULL DEFAULT 0;

--bun:split

COMMIT;
7 changes: 7 additions & 0 deletions cmd/bun/migrations/20240630181359_remove_url_count.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
BEGIN;
--bun:split

ALTER TABLE users DROP COLUMN url_count;
--bun:split

COMMIT;

0 comments on commit b9f1bd8

Please sign in to comment.