diff options
author | Jon Robertson <jonrober@stanford.edu> | 2014-10-09 22:24:18 -0700 |
---|---|---|
committer | Jon Robertson <jonrober@stanford.edu> | 2014-10-09 22:24:18 -0700 |
commit | 58186415a0f232cf84ced650ecc1326df66f9c6d (patch) | |
tree | 5b34314712a2dd22497dbeab8692a1f3edc03762 /perl/sql/Wallet-Schema-0.09-0.10-PostgreSQL.sql | |
parent | 94cfb1c7969515a863d7b0e09f00b6ced5f4fc5c (diff) |
Added new column in the Duo table
New column is required to differentiate the Duo table entries now that
we have more than one Duo object type. Added the new field and rebuilt
schema definitions and upgrade files.
Change-Id: Icf538eaded93f4f2820984c087d4850a586a7db1
Diffstat (limited to 'perl/sql/Wallet-Schema-0.09-0.10-PostgreSQL.sql')
-rw-r--r-- | perl/sql/Wallet-Schema-0.09-0.10-PostgreSQL.sql | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/perl/sql/Wallet-Schema-0.09-0.10-PostgreSQL.sql b/perl/sql/Wallet-Schema-0.09-0.10-PostgreSQL.sql new file mode 100644 index 0000000..c69e6a5 --- /dev/null +++ b/perl/sql/Wallet-Schema-0.09-0.10-PostgreSQL.sql @@ -0,0 +1,18 @@ +-- Convert schema 'sql/Wallet-Schema-0.09-PostgreSQL.sql' to 'sql/Wallet-Schema-0.10-PostgreSQL.sql':; + +BEGIN; + +ALTER TABLE duo DROP CONSTRAINT duo_pkey; + +ALTER TABLE duo ADD COLUMN du_type character varying(16) NOT NULL; + +CREATE INDEX duo_idx_du_type_du_name on duo (du_type, du_name); + +ALTER TABLE duo ADD PRIMARY KEY (du_name, du_type); + +ALTER TABLE duo ADD CONSTRAINT duo_fk_du_type_du_name FOREIGN KEY (du_type, du_name) + REFERENCES objects (ob_type, ob_name) DEFERRABLE; + + +COMMIT; + |