X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=contrib%2Fupgrade0.6-localdb.sql;h=d1449ac418516ba92294d4711328b2e856b5ce8d;hb=cc2d3611ed50f5965a9138ffaf3262417993c4f8;hp=dbf7789bd67cf4db4e98a3f12a0423edcb05b4dd;hpb=1b39ce3ff11a0c7cc742dc3f1aae2161df7cc6ab;p=cumulus.git diff --git a/contrib/upgrade0.6-localdb.sql b/contrib/upgrade0.6-localdb.sql index dbf7789..d1449ac 100644 --- a/contrib/upgrade0.6-localdb.sql +++ b/contrib/upgrade0.6-localdb.sql @@ -7,7 +7,8 @@ -- Database schema changes: the size and mtime columns were added to the -- segments table, and the segments_used table was added. Rather than upgrade -- the segments table in-place, we create a new table and then rename it over --- the old segments table. +-- the old segments table. The intent column was also added to the snapshots +-- table. create table segments_new ( segmentid integer primary key, segment text unique not null, @@ -23,6 +24,12 @@ create table segments_used ( utilization real ); +alter table snapshots add column intent real; + +-- Initialize the intent column; set all old snapshots to have intent 1 +-- (intended to be a daily snapshot). +update snapshots set intent = 1; + -- Compute the size of each of the segments, if possible, based on our -- knowledge of the objects stored in them. insert into segments_new