Skip to content

change create table foreign key with better function to modify and de…#7

Open
adinoid wants to merge 1 commit intosupabase-community:masterfrom
adinoid:feature/AmazingFeature
Open

change create table foreign key with better function to modify and de…#7
adinoid wants to merge 1 commit intosupabase-community:masterfrom
adinoid:feature/AmazingFeature

Conversation

@adinoid
Copy link

@adinoid adinoid commented Oct 3, 2021

change create table foreign key with better function to modify and delete

create table table_name (
id bigint generated by default as identity primary key,
product_id uuid references products (id) on delete cascade,
product_id uuid references products (id) on delete cascade on update cascade,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it will be better if on update cascade is placed on another sql script below, instead of appending it to the end.

Copy link
Author

Choose a reason for hiding this comment

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

I usually use on delete cascade on update cascade to make it more optimal and avoid errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants