adding stage1 table
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 21 Sep 2005 21:21:48 +0000 (21:21 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 21 Sep 2005 21:21:48 +0000 (21:21 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1851 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/reporter/config.sql

index 5211692..4c08b26 100644 (file)
@@ -1,11 +1,28 @@
-DROP SCEMA reporter CASCADE;
+DROP SCHEMA reporter CASCADE;
+
 CREATE SCHEMA reporter;
 
 BEGIN;
 
 CREATE SCHEMA reporter;
 
 BEGIN;
 
+CREATE TABLE reporter.stage1 (
+       id              serial                          primary key,
+       filename        text                            not null,
+       owner           int                             not null,
+       pub             bool                            not null
+                                                       default true,
+       create_date     timestamp with time zone        not null
+                                                       default now(),
+       edit_date       timestamp with time zone        not null
+                                                       default now()
+);
+
 CREATE TABLE reporter.stage2 (
        id              serial                          primary key,
 CREATE TABLE reporter.stage2 (
        id              serial                          primary key,
-       stage1          text                            not null,
+       stage1          int                             not null 
+                                                       references reporter.stage1 (id)
+                                                               on delete restrict
+                                                               deferrable
+                                                               initially deferred,
        filename        text                            not null,
        owner           int                             not null,
        pub             bool                            not null
        filename        text                            not null,
        owner           int                             not null,
        pub             bool                            not null