File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change
1
+ ALTER TABLE trees_watered DROP CONSTRAINT fk_trees_watered_trees;
1
2
UPDATE trees_watered SET tree_id = (SELECT gml_id FROM trees WHERE trees .id = trees_watered .tree_id );
3
+
4
+ ALTER TABLE trees_adopted DROP CONSTRAINT fk_trees_adopted_trees;
2
5
UPDATE trees_adopted SET tree_id = (SELECT gml_id FROM trees WHERE trees .id = trees_adopted .tree_id );
3
6
4
7
UPDATE trees SET id = gml_id;
5
- ALTER TABLE trees DROP COLUMN gml_id;
8
+
9
+ ALTER TABLE trees_watered
10
+ ADD CONSTRAINT fk_trees_watered_trees
11
+ FOREIGN KEY (tree_id)
12
+ REFERENCES trees (id)
13
+ ON DELETE CASCADE
14
+ ON UPDATE CASCADE;
15
+
16
+ ALTER TABLE trees_adopted
17
+ ADD CONSTRAINT fk_trees_adopted_trees
18
+ FOREIGN KEY (tree_id)
19
+ REFERENCES trees (id)
20
+ ON DELETE CASCADE
21
+ ON UPDATE CASCADE;
22
+
23
+ ALTER TABLE trees DROP COLUMN gml_id;
24
+
25
+ DROP TRIGGER insert_uuid on public .trees ;
26
+ DROP FUNCTION public .uuid_insert_trigger ;
You can’t perform that action at this time.
0 commit comments