Skip to content

Instantly share code, notes, and snippets.

@mfollett
Created August 1, 2011 21:08
Show Gist options
  • Save mfollett/1119008 to your computer and use it in GitHub Desktop.
Save mfollett/1119008 to your computer and use it in GitHub Desktop.
Create the bug_example schema
create schema bug_example;
create table bug_example.a (
id bigint PRIMARY KEY not null,
detail varchar(255)
);
create table bug_example.b (
id bigint PRIMARY KEY not null,
detail varchar(255)
);
create table bug_example.a_b (
a_id bigint,
b_id bigint,
PRIMARY KEY(a_id, b_id)
);
alter table bug_example.a_b ADD CONSTRAINT "a_b_a_id" FOREIGN KEY (a_id) REFERENCES bug_example.a(id);
alter table bug_example.a_b ADD CONSTRAINT "a_b_b_id" FOREIGN KEY (b_id) REFERENCES bug_example.b(id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment