more robust sql scripts adding IF EXISTS to DROP TABLE statementes
[brisk.git] / sql / sql.d / 070-add-mailmgmt.sql
index 8f8057a..bfd0a24 100644 (file)
@@ -1,7 +1,7 @@
 --
 --  Table to manage mails sent to users
 --
-DROP TABLE #PFX#mails;
+DROP TABLE IF EXISTS #PFX#mails;
 CREATE TABLE #PFX#mails (
        code       SERIAL PRIMARY KEY,
        ucode      integer REFERENCES #PFX#users (code) ON DELETE cascade ON UPDATE cascade,
@@ -10,4 +10,4 @@ CREATE TABLE #PFX#mails (
        subj       text,                              -- email subject
        body_txt   text,                              -- email body (text version)
        body_htm   text,                              -- email body (html version)
-       refs       text);                             -- email references
+       hash       text);                             -- reference hash to complete registration