Created
July 13, 2015 01:31
-
-
Save carld/5a47a9cbc9dfc6351cac to your computer and use it in GitHub Desktop.
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
-- reference Karwin | |
drop table closure; | |
drop table nodes; | |
create table nodes ( | |
node serial primary key, | |
label varchar(32) not null | |
); | |
create table closure ( | |
ancestor int not null, | |
descendant int not null, | |
primary key (ancestor, descendant), | |
foreign key (ancestor) references nodes(node) on delete cascade, | |
foreign key (descendant) references nodes(node) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment