Skip to content

Instantly share code, notes, and snippets.

@tomwhoiscontrary
Created December 10, 2012 20:45
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 tomwhoiscontrary/4253248 to your computer and use it in GitHub Desktop.
Save tomwhoiscontrary/4253248 to your computer and use it in GitHub Desktop.
SQL generated for the code in http://stackoverflow.com/a/13808904/116639
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