Created
December 10, 2012 20:45
-
-
Save tomwhoiscontrary/4253248 to your computer and use it in GitHub Desktop.
SQL generated for the code in http://stackoverflow.com/a/13808904/116639
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
create table Dashboard ( | |
id integer not null, | |
name varchar(255), | |
primary key (id) | |
); | |
create table User ( | |
id integer not null, | |
name varchar(255), | |
primary key (id) | |
); | |
create table User_dashboards ( | |
User_id integer not null, | |
dashboards boolean, | |
dashboards_KEY integer not null, | |
primary key (User_id, dashboards_KEY) | |
); | |
alter table User_dashboards | |
add constraint FK83F9CD33F31C6311 | |
foreign key (User_id) | |
references User; | |
alter table User_dashboards | |
add constraint FK83F9CD339BAE7A3C | |
foreign key (dashboards_KEY) | |
references Dashboard; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment