-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #408 from panoratech/add-projectID-table-attribute
🗃️ Added project ID to EAV Attribute table
- Loading branch information
Showing
1 changed file
with
51 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
-- ************************* SqlDBM: PostgreSQL ************************* | ||
-- *********** Generated by SqlDBM: Panora_DB by [email protected] ********** | ||
|
||
|
||
|
||
-- ************************************** webhooks_reponses | ||
|
||
|
@@ -74,10 +70,11 @@ CREATE TABLE users | |
password_hash text NULL, | ||
first_name text NOT NULL, | ||
last_name text NOT NULL, | ||
id_stytch text NULL, | ||
created_at timestamp NOT NULL DEFAULT NOW(), | ||
modified_at timestamp NOT NULL DEFAULT NOW(), | ||
CONSTRAINT PK_users PRIMARY KEY ( id_user ), | ||
CONSTRAINT unique_email UNIQUE ( email ) | ||
CONSTRAINT force_stytch_id_unique UNIQUE ( id_stytch ) | ||
); | ||
|
||
|
||
|
@@ -89,6 +86,7 @@ STYTCH_B2B | |
STYTCH_B2C'; | ||
COMMENT ON COLUMN users.created_at IS 'DEFAULT NOW() to automatically insert a value if nothing supplied'; | ||
|
||
COMMENT ON CONSTRAINT force_stytch_id_unique ON users IS 'force unique on stytch id'; | ||
|
||
|
||
|
||
|
@@ -224,21 +222,22 @@ COMMENT ON COLUMN entity.ressource_owner_id IS 'uuid of the ressource owner - ca | |
|
||
|
||
|
||
-- ************************************** connection_strategies | ||
|
||
CREATE TABLE connection_strategies | ||
|
||
-- ************************************** cs_values | ||
|
||
CREATE TABLE cs_values | ||
( | ||
id_connection_strategy uuid NOT NULL, | ||
status boolean NOT NULL, | ||
type text NOT NULL, | ||
id_project uuid NULL, | ||
CONSTRAINT PK_connection_strategies PRIMARY KEY ( id_connection_strategy ) | ||
id_cs_value uuid NOT NULL, | ||
value text NOT NULL, | ||
id_cs_attribute uuid NOT NULL, | ||
CONSTRAINT PK_ct_values PRIMARY KEY ( id_cs_value ) | ||
); | ||
|
||
|
||
|
||
COMMENT ON COLUMN connection_strategies.status IS 'if the connection strategy should overwrite default strategy (from env)'; | ||
COMMENT ON COLUMN connection_strategies.type IS 'OAUTH2, API_KEY, PIPEDRIVE_CLOUD_OAUTH, PIPEDRIVE_CLOUD_API, HUBSPOT_CLOUD'; | ||
|
||
|
||
|
||
|
||
|
||
|
@@ -248,11 +247,16 @@ CREATE TABLE cs_entities | |
( | ||
id_cs_entity uuid NOT NULL, | ||
id_connection_strategy uuid NOT NULL, | ||
CONSTRAINT PK_ct_entities PRIMARY KEY ( id_cs_entity ), | ||
CONSTRAINT FK_cs_id FOREIGN KEY ( id_connection_strategy ) REFERENCES connection_strategies ( id_connection_strategy ) | ||
CONSTRAINT PK_ct_entities PRIMARY KEY ( id_cs_entity ) | ||
); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
-- ************************************** cs_attributes | ||
|
||
CREATE TABLE cs_attributes | ||
|
@@ -261,21 +265,13 @@ CREATE TABLE cs_attributes | |
attribute_slug text NOT NULL, | ||
data_type text NOT NULL, | ||
id_cs_entity uuid NOT NULL, | ||
CONSTRAINT PK_ct_attributes PRIMARY KEY ( id_cs_attribute ), | ||
CONSTRAINT FK_cs_entity FOREIGN KEY ( id_cs_entity ) REFERENCES cs_entities ( id_cs_entity ) | ||
CONSTRAINT PK_ct_attributes PRIMARY KEY ( id_cs_attribute ) | ||
); | ||
|
||
|
||
-- ************************************** cs_values | ||
|
||
CREATE TABLE cs_values | ||
( | ||
id_cs_value uuid NOT NULL, | ||
value text NOT NULL, | ||
id_cs_attribute uuid NOT NULL, | ||
CONSTRAINT PK_ct_values PRIMARY KEY ( id_cs_value ), | ||
CONSTRAINT FK_cs_attribute FOREIGN KEY ( id_cs_attribute ) REFERENCES cs_attributes ( id_cs_attribute ) | ||
); | ||
|
||
|
||
|
||
|
||
|
||
|
@@ -316,6 +312,32 @@ CREATE TABLE crm_deals_stages | |
); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
-- ************************************** connection_strategies | ||
|
||
CREATE TABLE connection_strategies | ||
( | ||
id_connection_strategy uuid NOT NULL, | ||
status boolean NOT NULL, | ||
type text NOT NULL, | ||
id_project uuid NULL, | ||
CONSTRAINT PK_connection_strategies PRIMARY KEY ( id_connection_strategy ) | ||
); | ||
|
||
|
||
|
||
COMMENT ON COLUMN connection_strategies.status IS 'if the connection strategy should overwrite default strategy (from env)'; | ||
COMMENT ON COLUMN connection_strategies.type IS 'OAUTH2, API_KEY, PIPEDRIVE_CLOUD_OAUTH, PIPEDRIVE_CLOUD_API, HUBSPOT_CLOUD'; | ||
|
||
|
||
|
||
|
||
|
||
-- ************************************** tcg_tickets | ||
|
||
CREATE TABLE tcg_tickets | ||
|
@@ -490,6 +512,7 @@ CREATE TABLE attribute | |
remote_id text NOT NULL, | ||
"source" text NOT NULL, | ||
id_entity uuid NULL, | ||
id_project uuid NOT NULL, | ||
"scope" text NOT NULL, | ||
id_consumer uuid NULL, | ||
CONSTRAINT PK_attribute PRIMARY KEY ( id_attribute ), | ||
|
@@ -1112,14 +1135,14 @@ CREATE TABLE connections | |
id_connection uuid NOT NULL, | ||
status text NOT NULL, | ||
provider_slug text NOT NULL, | ||
vertical text NOT NULL, | ||
account_url text NULL, | ||
token_type text NOT NULL, | ||
access_token text NULL, | ||
refresh_token text NULL, | ||
expiration_timestamp timestamp NULL, | ||
created_at timestamp NOT NULL, | ||
connection_token text NULL, | ||
vertical text NOT NULL, | ||
id_project uuid NOT NULL, | ||
id_linked_user uuid NOT NULL, | ||
CONSTRAINT PK_connections PRIMARY KEY ( id_connection ), | ||
|