chiark / gitweb /
sql/update-*-v2.sql: Scripts to upgrade existing database schemata.
[odin-cgi] / sql / update-pastebin-v2.sql
1 /* -*-sql-*-
2  *
3  * Plain old SQL for setting up the tables for Odin web services.
4  */
5
6 begin;
7 alter table odin_pastebin alter column lang set default 'txt';
8 alter table odin_pastebin rename column stamp to oldstamp;
9 alter table odin_pastebin add column stamp bigint not null default 0;
10 update odin_pastebin set stamp = extract(epoch from oldstamp);
11 commit;
12
13 begin;
14 alter table odin_pastebin drop column oldstamp;
15 alter table odin_pastebin alter column stamp drop default;
16 commit;