3 INSERT INTO config.upgrade_log (version) VALUES ('0133'); -- atz
5 CREATE TABLE config.remote_account (
8 host TEXT NOT NULL, -- name or IP, :port optional
9 username TEXT, -- optional, since we could default to $USER
10 password TEXT, -- optional, since we could use SSH keys, or anonymous login.
11 account TEXT, -- aka profile or FTP "account" command
12 path TEXT, -- aka directory
13 owner INT NOT NULL REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED,
14 last_activity TIMESTAMP WITH TIME ZONE
17 CREATE TABLE acq.edi_account ( -- similar tables can extend remote_account for other parts of EG
18 provider INT NOT NULL REFERENCES acq.provider (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
19 in_dir TEXT -- incoming messages dir (probably different than config.remote_account.path, the outgoing dir)
20 ) INHERITS (config.remote_account);
22 -- We need a UNIQUE constraint here also, to support the FK in the next command
23 ALTER TABLE acq.edi_account ADD CONSTRAINT acq_edi_account_id_unique UNIQUE (id);
25 -- null edi_default is OK... it has to be, since we have no values in acq.edi_account yet
26 ALTER TABLE acq.provider ADD COLUMN edi_default INT REFERENCES acq.edi_account (id) DEFERRABLE INITIALLY DEFERRED;