Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 28, 2020 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/ba7ad918e293997afdc514846a09590f to your computer and use it in GitHub Desktop.
Save parzibyte/ba7ad918e293997afdc514846a09590f to your computer and use it in GitHub Desktop.
CREATE TABLE otra_tabla(
id bigint unsigned not null primary key auto_increment,
un_campo varchar(255) not null,
id_tabla_principal bigint unsigned not null,
foreign key (id_tabla_principal) references tabla(id) on delete cascade on update cascade
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment