Skip to content
Newer
Older
100644 27 lines (15 sloc) 839 Bytes
cdc4e5f Added Schema-Updating Database Class, pre-work for nice report overvi…
oliver authored
1 /* Script to update apps.db from schema version 0 to 1 */
2
4142833 Split Database out of BirneConnect, experimental support for monthly …
oliver authored
3 begin exclusive transaction;
cdc4e5f Added Schema-Updating Database Class, pre-work for nice report overvi…
oliver authored
4
5 /* Add the meta table to keep the schema_version */
6
7 create table meta (schema_version integer);
8 insert into meta (schema_version) values (1);
9
10 /* temp table */
11
12 create table update_report as select * from report;
13
14 /* create new report table with additional column report_region_id */
15
16 drop table report;
17 CREATE TABLE report (id INTEGER PRIMARY KEY, report_type_id INTEGER, report_region_id INTEGER, from_date DATE, until_date DATE, downloaded_date DATE);
18
19 /* copy previous reports back to table */
20
4142833 Split Database out of BirneConnect, experimental support for monthly …
oliver authored
21 insert into report (id, report_type_id, report_region_id, from_date, until_date, downloaded_date) select id, report_type_id, 0, from_date, until_date, downloaded_date from update_report;
cdc4e5f Added Schema-Updating Database Class, pre-work for nice report overvi…
oliver authored
22
23 /* clean up temp table */
24
25 drop table update_report;
26
27 commit;
Something went wrong with that request. Please try again.