chiark / gitweb /
Make a licensing decision: it's all AGPLv3+.
[odin-cgi] / sql / setup-pastebin.sql
index 06d35449fb878aea8f651e5882005e91f840f107..a21ec548ec096ba526dc346ffc58a74feeeebf61 100644 (file)
@@ -1,6 +1,27 @@
 /* -*-sql-*-
  *
  * Plain old SQL for setting up the tables for Odin web services.
 /* -*-sql-*-
  *
  * Plain old SQL for setting up the tables for Odin web services.
+ *
+ * (c) 2015 Mark Wooding
+ */
+
+/*----- Licensing notice ----------------------------------------------------
+ *
+ * This file is part of the `odin.gg' service, `odin-cgi'.
+ *
+ * `odin-cgi' is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation; either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * `odin-cgi' is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with `odin-cgi'; if not, see
+ * <http://www.gnu.org/licenses/>.
  */
 
 /* The various tools assume that the database is appropriate configured with
  */
 
 /* The various tools assume that the database is appropriate configured with
@@ -14,7 +35,7 @@ drop table if exists odin_pastebin_lang;
 drop table if exists odin_pastebin_seq;
 
 create table odin_pastebin_lang
 drop table if exists odin_pastebin_seq;
 
 create table odin_pastebin_lang
-       (lang varchar(32) primary key
+       (lang varchar(32) primary key,
         descr varchar(64) not null);
 insert into odin_pastebin_lang (lang, descr) values ('txt', 'Plain text');
 
         descr varchar(64) not null);
 insert into odin_pastebin_lang (lang, descr) values ('txt', 'Plain text');
 
@@ -23,12 +44,12 @@ insert into odin_pastebin_seq (seq) values (10000);
 
 create table odin_pastebin
        (tag varchar(16) primary key,
 
 create table odin_pastebin
        (tag varchar(16) primary key,
-        stamp timestamp not null default current_timestamp,
+        stamp bigint not null,
         edithash varchar(128) not null,
         owner varchar(64) not null,
         title varchar(128) not null,
         lang varchar(32) not null
         edithash varchar(128) not null,
         owner varchar(64) not null,
         title varchar(128) not null,
         lang varchar(32) not null
-               default 'plain-text'
+               default 'txt'
                references odin_pastebin_lang (lang)
                        on update cascade
                        on delete set default
                references odin_pastebin_lang (lang)
                        on update cascade
                        on delete set default