diff options
Diffstat (limited to 'sql/Pg-upgrade-2.6.17-2.6.18.sql')
-rw-r--r-- | sql/Pg-upgrade-2.6.17-2.6.18.sql | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/Pg-upgrade-2.6.17-2.6.18.sql b/sql/Pg-upgrade-2.6.17-2.6.18.sql index 0ed4e0da..36f52a04 100644 --- a/sql/Pg-upgrade-2.6.17-2.6.18.sql +++ b/sql/Pg-upgrade-2.6.17-2.6.18.sql @@ -11,6 +11,9 @@ ALTER TABLE acc_trans ALTER COLUMN entry_id SET DEFAULT nextval('acctrans_entry_ UPDATE acc_trans SET entry_id = nextval('acctrans_entry_id_seq'); ALTER TABLE acc_trans ADD PRIMARY key (entry_id); +-- We should probably add a foreign key to chart.id +ALTER TABLE acc_trans ADD FOREIGN KEY (chart_id) REFERENCES chart (id); + -- Start changing floats ALTER TABLE acc_trans ALTER COLUMN amount TYPE numeric(10,2); @@ -220,5 +223,6 @@ DO ALSO INSERT INTO id_tracker (id, table_name) VALUES (new.id, 'employee'); CREATE RULE warehouse_id_track_u AS ON update TO warehouse DO ALSO UPDATE id_tracker SET id = new.id WHERE id = old.id; + COMMIT; |