ALTER TABLE paid ADD CONSTRAINT paid_pkey PRIMARY KEY (user_id) ;
ALTER TABLE node_msg ADD CONSTRAINT node_msg_pkey PRIMARY KEY (node_id) ;
ALTER TABLE file_avatar ADD CONSTRAINT file_avatar_pkey PRIMARY KEY (user_id, name) ;
ALTER TABLE configuration ADD CONSTRAINT configuration_pkey PRIMARY KEY (name) ;
ALTER TABLE node ADD CONSTRAINT node_pkey PRIMARY KEY (node_id) ;
ALTER TABLE file_temp ADD CONSTRAINT file_temp_pkey PRIMARY KEY (user_id, name) ;
ALTER TABLE file_site ADD CONSTRAINT file_site_pkey PRIMARY KEY (name) ;
ALTER TABLE module ADD CONSTRAINT module_pkey PRIMARY KEY (module_name) ;
ALTER TABLE mailing_list ADD CONSTRAINT mailing_list_pkey PRIMARY KEY (node_id) ;
ALTER TABLE file_node ADD CONSTRAINT file_node_pkey PRIMARY KEY (node_id, name) ;
ALTER TABLE site ADD CONSTRAINT site_pkey PRIMARY KEY (one) ;
ALTER TABLE registration ADD CONSTRAINT registration_pkey PRIMARY KEY (key_) ;
ALTER TABLE site_property ADD CONSTRAINT site_property_pkey PRIMARY KEY (key) ;
ALTER TABLE view_count ADD CONSTRAINT view_count_pkey PRIMARY KEY (node_id) ;
ALTER TABLE user_ ADD CONSTRAINT user__pkey PRIMARY KEY (user_id) ;
ALTER TABLE user_property ADD CONSTRAINT user_property_pkey PRIMARY KEY (user_id, key) ;
ALTER TABLE tweak ADD CONSTRAINT tweak_pkey PRIMARY KEY (tweak_name) ;
ALTER TABLE visited ADD CONSTRAINT visited_pkey PRIMARY KEY (user_id, node_id) ;
ALTER TABLE node_property ADD CONSTRAINT node_property_pkey PRIMARY KEY (node_id, key) ;
ALTER TABLE subscription ADD CONSTRAINT subscription_pkey PRIMARY KEY (user_id, node_id) ;
ALTER TABLE paid ADD CONSTRAINT paid_user_id_fkey FOREIGN KEY (user_id) REFERENCES user_(user_id) ON DELETE CASCADE ;
ALTER TABLE view_count ADD CONSTRAINT view_count_node_id_fkey FOREIGN KEY (node_id) REFERENCES node(node_id) ON DELETE CASCADE ;
ALTER TABLE file_avatar ADD CONSTRAINT file_avatar_user_id_fkey FOREIGN KEY (user_id) REFERENCES user_(user_id) ON DELETE CASCADE ;
ALTER TABLE tag ADD CONSTRAINT tag_user_id_fkey FOREIGN KEY (user_id) REFERENCES user_(user_id) ON DELETE CASCADE ;
ALTER TABLE tag ADD CONSTRAINT tag_node_id_fkey FOREIGN KEY (node_id) REFERENCES node(node_id) ON DELETE CASCADE ;
ALTER TABLE node ADD CONSTRAINT node_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES node(node_id) ON DELETE CASCADE ;
ALTER TABLE node ADD CONSTRAINT node_node_id_fkey FOREIGN KEY (node_id) REFERENCES node_msg(node_id) DEFERRABLE INITIALLY DEFERRED ;
ALTER TABLE node ADD CONSTRAINT node_new_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES user_(user_id) ;
ALTER TABLE user_property ADD CONSTRAINT user_property_user_id_fkey FOREIGN KEY (user_id) REFERENCES user_(user_id) ON DELETE CASCADE ;
ALTER TABLE file_temp ADD CONSTRAINT file_temp_user_id_fkey FOREIGN KEY (user_id) REFERENCES user_(user_id) ON DELETE CASCADE ;
ALTER TABLE subscription ADD CONSTRAINT subscription_user_id_fkey FOREIGN KEY (user_id) REFERENCES user_(user_id) ON DELETE CASCADE ;
ALTER TABLE subscription ADD CONSTRAINT subscription_node_id_fkey FOREIGN KEY (node_id) REFERENCES node(node_id) ON DELETE CASCADE ;
ALTER TABLE visited ADD CONSTRAINT visited_user_id_fkey FOREIGN KEY (user_id) REFERENCES user_(user_id) ON DELETE CASCADE ;
ALTER TABLE mailing_list ADD CONSTRAINT mailing_list_node_id_fkey FOREIGN KEY (node_id) REFERENCES node(node_id) ON DELETE CASCADE ;
ALTER TABLE visited ADD CONSTRAINT visited_node_id_fkey FOREIGN KEY (node_id) REFERENCES node(node_id) ON DELETE CASCADE ;
ALTER TABLE file_node ADD CONSTRAINT file_node_node_id_fkey FOREIGN KEY (node_id) REFERENCES node(node_id) ON DELETE CASCADE ;
ALTER TABLE visited ADD CONSTRAINT visited_last_node_id_fkey FOREIGN KEY (last_node_id) REFERENCES node(node_id) ON DELETE CASCADE ;
ALTER TABLE site ADD CONSTRAINT site_root_node_id_fkey FOREIGN KEY (root_node_id) REFERENCES node(node_id) DEFERRABLE INITIALLY DEFERRED ;
ALTER TABLE node_msg ADD CONSTRAINT node_msg_node_id_fkey FOREIGN KEY (node_id) REFERENCES node(node_id) ON DELETE CASCADE ;
ALTER TABLE node_property ADD CONSTRAINT node_property_node_id_fkey FOREIGN KEY (node_id) REFERENCES node(node_id) ON DELETE CASCADE ;
