diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/Pg-upgrade-2.6.17-2.6.18.sql | 11 |
1 files changed, 11 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 new file mode 100644 index 00000000..693fed80 --- /dev/null +++ b/sql/Pg-upgrade-2.6.17-2.6.18.sql @@ -0,0 +1,11 @@ +-- adding primary key to acc_trans + +BEGIN; +LOCK acc_trans in EXCLUSIVE mode; +ALTER TABLE acc_trans ADD COLUMN entry_id bigint; +CREATE SEQUENCE acctrans_entry_id_seq; +ALTER TABLE acc_trans ALTER COLUMN entry_id SET DEFAULT nextval('acctrans_entry_id_seq'); +UPDATE acc_trans SET entry_id = nextval('acctrans_entry_id_seq'); +ALTER TABLE acc_trans ADD PRIMARY key (entry_id); +COMMIT; + |