feat: ✨ contact rethinked and user_contact created
This commit is contained in:
parent
aa679b5a05
commit
e167b864ee
19 changed files with 261 additions and 29 deletions
|
@ -1,5 +1,5 @@
|
|||
-- Add up migration script here
|
||||
CREATE TABLE IF NOT EXISTS "contact"(
|
||||
user_id BIGSERIAL PRIMARY KEY NOT NULL UNIQUE,
|
||||
email VARCHAR(255) NOT NULL UNIQUE
|
||||
id BIGSERIAL PRIMARY KEY NOT NULL UNIQUE,
|
||||
name VARCHAR(255) NOT NULL UNIQUE
|
||||
);
|
2
migrations/20241215002127_user_contact.down.sql
Normal file
2
migrations/20241215002127_user_contact.down.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
-- Add down migration script here
|
||||
DROP TABLE IF EXISTS "user_contact";
|
6
migrations/20241215002127_user_contact.up.sql
Normal file
6
migrations/20241215002127_user_contact.up.sql
Normal file
|
@ -0,0 +1,6 @@
|
|||
-- Add up migration script here
|
||||
CREATE TABLE IF NOT EXISTS "user_contact"(
|
||||
user_id BIGSERIAL NOT NULL REFERENCES "user"(id),
|
||||
contact_id BIGSERIAL NOT NULL REFERENCES "contact"(id),
|
||||
PRIMARY KEY (user_id, contact_id)
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue