chiark / gitweb /
sql/update-*-v2.sql: Scripts to upgrade existing database schemata.
[odin-cgi] / sql / update-shorturl-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_shorturl rename column stamp to oldstamp;
8 alter table odin_shorturl add column stamp bigint not null default 0;
9 update odin_shorturl set stamp = extract(epoch from oldstamp);
10 commit;
11
12 begin;
13 alter table odin_shorturl drop column oldstamp;
14 alter table odin_shorturl alter column stamp drop default;
15 commit;