Created
August 29, 2011 10:52
-
-
Save n0nick/1178174 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
CREATE TABLE external_directory( | |
id BIGINT NOT NULL, | |
parent_id BIGINT NOT NULL DEFAULT 0, | |
name VARCHAR(40) DEFAULT NULL, | |
iconname VARCHAR(40) DEFAULT NULL, | |
enabled BOOLEAN DEFAULT true, | |
keywords VARCHAR(120) DEFAULT NULL | |
); | |
CREATE SEQUENCE external_directory_id_seq | |
START WITH 1 | |
INCREMENT BY 1 | |
NO MINVALUE | |
NO MAXVALUE | |
CACHE 1; | |
ALTER SEQUENCE external_directory_id_seq OWNED BY external_directory.id; | |
ALTER TABLE external_directory ALTER COLUMN id SET DEFAULT nextval('external_directory_id_seq'::regclass); | |
ALTER TABLE ONLY external_directory ADD CONSTRAINT external_directory_pkey PRIMARY KEY (id); | |
CREATE TABLE external_provider_directory( | |
provider_id BIGINT REFERENCES external_providers(id), | |
category_id BIGINT REFERENCES external_directory(id) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment