Skip to content

Instantly share code, notes, and snippets.

@nazarov-yuriy
Last active December 16, 2015 11:18
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 nazarov-yuriy/5426154 to your computer and use it in GitHub Desktop.
Save nazarov-yuriy/5426154 to your computer and use it in GitHub Desktop.
create table SOMEPROJECT_USERS(
ID int not null auto_increment,
NAME varchar(32),
primary key (ID),
key (NAME)
);
create table SOMEPROJECT_SHARES(
ID int not null auto_increment,
NAME varchar(32),
primary key (ID),
key (NAME)
);
create table SOMEPROJECT_LINKS(
USER_ID int not null,
SHARE_ID int not null,
primary key (USER_ID, SHARE_ID),
constraint FK_LINKS_TO_USERS foreign key (USER_ID) references SOMEPROJECT_USERS(ID),
constraint FK_LINKS_TO_SHARES foreign key (SHARE_ID) references SOMEPROJECT_SHARES(ID)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment