sql/1.sql
changeset 12 191b3c25974a
parent 10 d07309450285
child 13 23a242d7b7fa
equal deleted inserted replaced
11:9aa5114326e8 12:191b3c25974a
     1 --- vim: set noet nosta sw=4 ts=4 ft=sql:
     1 --- vim: set noet nosta sw=4 ts=4 ft=sql:
     2 
       
     3 BEGIN;
     2 BEGIN;
     4 
     3 
     5 DROP TABLE IF EXISTS rules;
     4 DROP TABLE IF EXISTS requests;
     6 CREATE TABLE rules (
     5 CREATE TABLE requests (
       
     6 	hi INT,
       
     7 	rewrite_rule INTEGER REFERENCES rewrite_rules( id ) ON DELETE SET NULL ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED 
       
     8 );
       
     9 
       
    10 DROP TABLE IF EXISTS rewrite_rules;
       
    11 CREATE TABLE rewrite_rules (
       
    12 	id    INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
     7 	redir TINYINT NOT NULL DEFAULT 0 CHECK( redir IN (0,1,2) )
    13 	redir TINYINT NOT NULL DEFAULT 0 CHECK( redir IN (0,1,2) )
     8 );
    14 );
     9 
    15 
    10 COMMIT;
    16 COMMIT;