Created
August 1, 2011 21:08
-
-
Save mfollett/1119008 to your computer and use it in GitHub Desktop.
Create the bug_example schema
This file contains hidden or 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 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