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