chiark / gitweb /
Initial commit.
[odin-cgi] / sql / setup-shorturl.sql
CommitLineData
be24e9af
MW
1/* -*-sql-*-
2 *
3 * Plain old SQL for setting up the tables for Odin web services.
4 */
5
6/* The various tools assume that the database is appropriate configured with
7 * the SERIALIZABLE isolation level.
8 */
9
10begin;
11
12drop table odin_shorturl;
13drop table odin_shorturl_seq;
14
15create table odin_shorturl_seq (seq int);
16insert into odin_shorturl_seq (seq) values (10000);
17
18create table odin_shorturl
19 (tag varchar(16) primary key,
20 stamp timestamp not null default current_timestamp,
21 owner varchar(64) not null,
22 url text not null);
23create index odin_shorturl_by_owner on odin_shorturl (owner);
24
25commit;