changeset 1012:875b0a9a3c92

Fixed schema definition of import queue.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 23 Oct 2018 11:32:47 +0200
parents 9d4af4b1c5c8
children 15c3cc6f29a4
files schema/gemma.sql
diffstat 1 files changed, 27 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/schema/gemma.sql	Tue Oct 23 11:27:35 2018 +0200
+++ b/schema/gemma.sql	Tue Oct 23 11:32:47 2018 +0200
@@ -500,33 +500,33 @@
         CHECK(measure_type = 'minimum guaranteed'
             OR value_lifetime IS NOT NULL)
     )
-
-    --
-    -- Import queue and respective logging
-    --
-    CREATE TYPE import_state AS ENUM ('queued', 'running', 'successful', 'failed')
-
-    CREATE TABLE imports (
-        id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
-        state import_state NOT NULL DEFAULT 'queued',
-        enqueued timestamp NOT NULL DEFAULT now(),
-        kind  varchar NOT NULL,
-        username varchar NOT NULL
-            REFERENCES internal.user_profiles(username)
-                ON DELETE CASCADE ON UPDATE CASCADE,
-        data TEXT
-    )
-
-    CREATE INDEX enqueued_idx ON imports(enqueued, state)
-
-    CREATE TYPE log_type AS ENUM ('info', 'warn', 'error')
-
-    CREATE TABLE import_logs (
-        import_id int NOT NULL REFERENCES imports(id),
-        time timestamp NOT NULL DEFAULT now(),
-        kind log_type NOT NULL DEFAULT 'info',
-        msg TEXT NOT NULL
-    )
 ;
 
+--
+-- Import queue and respective logging
+--
+CREATE TYPE waterway.import_state AS ENUM ('queued', 'running', 'successful', 'failed');
+
+CREATE TABLE waterway.imports (
+    id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
+    state waterway.import_state NOT NULL DEFAULT 'queued',
+    enqueued timestamp NOT NULL DEFAULT now(),
+    kind  varchar NOT NULL,
+    username varchar NOT NULL
+        REFERENCES internal.user_profiles(username)
+            ON DELETE CASCADE ON UPDATE CASCADE,
+    data TEXT
+);
+
+CREATE INDEX enqueued_idx ON waterway.imports(enqueued, state);
+
+CREATE TYPE waterway.log_type AS ENUM ('info', 'warn', 'error');
+
+CREATE TABLE waterway.import_logs (
+    import_id int NOT NULL REFERENCES waterway.imports(id),
+    time timestamp NOT NULL DEFAULT now(),
+    kind waterway.log_type NOT NULL DEFAULT 'info',
+    msg TEXT NOT NULL
+);
+
 COMMIT;