Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE mboxes (
- id INTEGER NOT NULL,
- -- ...
- is_login_alias BOOLEAN DEFAULT FALSE NOT NULL,
- parent_id INTEGER
- );
- CREATE SEQUENCE seq_mboxes_id
- START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
- ALTER SEQUENCE seq_mboxes_id
- OWNED BY mboxes.id;
- ALTER TABLE mboxes
- ALTER COLUMN id SET DEFAULT nextval('seq_mboxes_id'::regclass);
- ALTER TABLE mboxes
- ADD CONSTRAINT mboxes_pkey PRIMARY KEY (id);
- ALTER TABLE mboxes
- ADD CONSTRAINT mboxes_fkey_self
- FOREIGN KEY (parent_id) REFERENCES mboxes(id) ON DELETE CASCADE;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement