Skip to content

Commit

Permalink
updated postgresql scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Feb 1, 2015
1 parent d12a08c commit e87ef33
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 106 deletions.
Expand Up @@ -3,16 +3,18 @@ DROP TABLE m_org_closure;
DROP TABLE IF EXISTS m_org_incorrect;

CREATE TABLE m_org_closure (
descendant_oid VARCHAR(36) NOT NULL,
ancestor_oid VARCHAR(36) NOT NULL,
val INT4 NOT NULL,
PRIMARY KEY (descendant_oid, ancestor_oid)
descendant_oid VARCHAR(36) NOT NULL,
val INT4,
PRIMARY KEY (ancestor_oid, descendant_oid)
);

CREATE INDEX iAncestor ON m_org_closure (ancestor_oid);

CREATE INDEX iDescendant ON m_org_closure (descendant_oid);

CREATE INDEX iDescendantAncestor ON m_org_closure (descendant_oid, ancestor_oid);

ALTER TABLE m_org_closure
ADD CONSTRAINT fk_ancestor
FOREIGN KEY (ancestor_oid)
Expand Down

0 comments on commit e87ef33

Please sign in to comment.