-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🗃️ Added project ID to EAV Attribute table #408
Merged
+51
−28
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ), | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Several files in the codebase still use the old table and column names from
connection_strategies
. Here are the specific locations that need attention:packages/api/scripts/init.sql
: References toconnection_strategies
,id_connection_strategy
,status
, andtype
are found in multiple places within this file.Please ensure that all these references are updated to reflect the new table name
cs_values
and the new column names to prevent runtime errors.Analysis chain
The renaming of the table and columns in
cs_values
is consistent with the summary. Ensure that all references to these columns and the table are updated across the application to prevent runtime errors.Scripts Executed
The following scripts were executed for the analysis:
Script:
Length of output: 3515