Skip to content

Commit

Permalink
add id primary key
Browse files Browse the repository at this point in the history
  • Loading branch information
domino14 committed Nov 27, 2024
1 parent 814d8e1 commit e02e934
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions db/migrations/000003_id_column.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
BEGIN;

-- Drop the id column
ALTER TABLE wordvault_cards
DROP COLUMN id;

-- Drop the sequence created for the id column, if it exists
DROP SEQUENCE IF EXISTS wordvault_cards_id_seq;

COMMIT;
6 changes: 6 additions & 0 deletions db/migrations/000003_id_column.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
BEGIN;

ALTER TABLE wordvault_cards
ADD COLUMN id BIGSERIAL PRIMARY KEY;

COMMIT;

0 comments on commit e02e934

Please sign in to comment.