Commit | Line | Data |
---|---|---|
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 | ||
10 | begin; | |
11 | ||
697afe0d MW |
12 | drop table if exists odin_shorturl; |
13 | drop table if exists odin_shorturl_seq; | |
be24e9af MW |
14 | |
15 | create table odin_shorturl_seq (seq int); | |
16 | insert into odin_shorturl_seq (seq) values (10000); | |
17 | ||
18 | create table odin_shorturl | |
19 | (tag varchar(16) primary key, | |
3300e9a2 | 20 | stamp bigint not null, |
be24e9af MW |
21 | owner varchar(64) not null, |
22 | url text not null); | |
23 | create index odin_shorturl_by_owner on odin_shorturl (owner); | |
bdae614e | 24 | create index odin_shorturl_by_url_owner on odin_shorturl (url, owner); |
be24e9af MW |
25 | |
26 | commit; |