Skip to content
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 PK on connection strategy EAV tables #342

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions packages/api/scripts/init.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


-- ************************************** webhooks_reponses

CREATE TABLE webhooks_reponses
Expand Down Expand Up @@ -229,8 +230,8 @@ CREATE TABLE cs_values
(
id_cs_value uuid NOT NULL,
value text NOT NULL,
id_ct_attribute uuid NOT NULL

id_ct_attribute uuid NOT NULL,
CONSTRAINT PK_ct_values PRIMARY KEY ( id_cs_value )
Comment on lines +233 to +234
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The primary key constraint name PK_ct_values does not match the table name cs_values. It's crucial for the constraint name to reflect the table it belongs to for clarity and consistency.

- CONSTRAINT PK_ct_values PRIMARY KEY ( id_cs_value )
+ CONSTRAINT PK_cs_values PRIMARY KEY ( id_cs_value )

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
id_ct_attribute uuid NOT NULL,
CONSTRAINT PK_ct_values PRIMARY KEY ( id_cs_value )
id_ct_attribute uuid NOT NULL,
CONSTRAINT PK_cs_values PRIMARY KEY ( id_cs_value )

);


Expand All @@ -245,8 +246,8 @@ CREATE TABLE cs_values
CREATE TABLE cs_entities
(
id_cs_entity uuid NOT NULL,
id_connection_strategy uuid NOT NULL

id_connection_strategy uuid NOT NULL,
CONSTRAINT PK_ct_entities PRIMARY KEY ( id_cs_entity )
Comment on lines +249 to +250
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The primary key constraint name PK_ct_entities does not match the table name cs_entities. Naming conventions should be consistent across the database schema.

- CONSTRAINT PK_ct_entities PRIMARY KEY ( id_cs_entity )
+ CONSTRAINT PK_cs_entities PRIMARY KEY ( id_cs_entity )

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
id_connection_strategy uuid NOT NULL,
CONSTRAINT PK_ct_entities PRIMARY KEY ( id_cs_entity )
id_connection_strategy uuid NOT NULL,
CONSTRAINT PK_cs_entities PRIMARY KEY ( id_cs_entity )

);


Expand All @@ -263,8 +264,8 @@ CREATE TABLE cs_attributes
id_cs_attribute uuid NOT NULL,
id_cs_entity uuid NOT NULL,
attribute_slug text NOT NULL,
data_type text NOT NULL

data_type text NOT NULL,
CONSTRAINT PK_ct_attributes PRIMARY KEY ( id_cs_attribute )
Comment on lines +267 to +268
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The primary key constraint name PK_ct_attributes does not match the table name cs_attributes. Consistent naming helps in maintaining and understanding the database schema.

- CONSTRAINT PK_ct_attributes PRIMARY KEY ( id_cs_attribute )
+ CONSTRAINT PK_cs_attributes PRIMARY KEY ( id_cs_attribute )

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
data_type text NOT NULL,
CONSTRAINT PK_ct_attributes PRIMARY KEY ( id_cs_attribute )
data_type text NOT NULL,
CONSTRAINT PK_cs_attributes PRIMARY KEY ( id_cs_attribute )

);


Expand Down Expand Up @@ -323,8 +324,8 @@ CREATE TABLE connection_strategies
(
id_connection_strategy uuid NOT NULL,
type text NOT NULL,
id_project uuid NULL

id_project uuid NULL,
CONSTRAINT PK_connection_strategies PRIMARY KEY ( id_connection_strategy )
);


Expand Down
Loading