--
-- 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,
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