diff options
Diffstat (limited to 'upgrades/dbpatches/1.4/postgresql/patch/history.sql')
-rw-r--r-- | upgrades/dbpatches/1.4/postgresql/patch/history.sql | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/upgrades/dbpatches/1.4/postgresql/patch/history.sql b/upgrades/dbpatches/1.4/postgresql/patch/history.sql new file mode 100644 index 00000000..aa7a9664 --- /dev/null +++ b/upgrades/dbpatches/1.4/postgresql/patch/history.sql @@ -0,0 +1,10 @@ +CREATE TABLE history_tmp ( + itemid bigint DEFAULT '0' NOT NULL, + clock integer DEFAULT '0' NOT NULL, + value numeric(16,4) DEFAULT '0.0000' NOT NULL +); +CREATE INDEX history_1 on history_tmp (itemid,clock); + +insert into history_tmp select * from history; +drop table history; +alter table history_tmp rename to history; |