/* -*-sql-*-
 *
 * Plain old SQL for setting up the tables for Odin web services.
 */

begin;
alter table odin_pastebin alter column lang set default 'txt';
alter table odin_pastebin rename column stamp to oldstamp;
alter table odin_pastebin add column stamp bigint not null default 0;
update odin_pastebin set stamp = extract(epoch from oldstamp);
commit;

begin;
alter table odin_pastebin drop column oldstamp;
alter table odin_pastebin alter column stamp drop default;
commit;
