Skip to content

Commit

Permalink
db model update
Browse files Browse the repository at this point in the history
  • Loading branch information
rflihxyz committed Nov 2, 2023
1 parent 7a683bc commit bc0a6ac
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/api/scripts/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -189,22 +189,22 @@ CREATE INDEX crm_contactID_crm_contact_email_address ON crm_contact_email_addres

CREATE TABLE api_keys
(
id_api_key bigint NOT NULL GENERATED ALWAYS AS IDENTITY,
api_key text NOT NULL,
id_project int NULL,
id_api_key bigint NOT NULL GENERATED ALWAYS AS IDENTITY,
api_key_hash text NOT NULL,
id_project int NOT NULL,
id_user int NOT NULL,
CONSTRAINT id_ PRIMARY KEY ( id_api_key ),
CONSTRAINT unique_api_keys UNIQUE ( api_key ),
CONSTRAINT FK_7 FOREIGN KEY ( id_project ) REFERENCES projects ( id_project )
CONSTRAINT unique_api_keys UNIQUE ( api_key_hash ),
CONSTRAINT FK_7 FOREIGN KEY ( id_project ) REFERENCES projects ( id_project ),
CONSTRAINT FK_8 FOREIGN KEY ( id_user ) REFERENCES users ( id_user )
);

CREATE INDEX FK_1 ON api_keys
(
id_project
);







CREATE INDEX FK_2 ON api_keys
(
id_user
);

0 comments on commit bc0a6ac

Please sign in to comment.