From: scottmk Date: Thu, 16 Sep 2010 15:38:03 +0000 (+0000) Subject: Make acq.provider_contact.name NOT NULL. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f1d72820b1eb347dcc46bb158aef302c6ea881a6;p=evergreen%2Fbjwebb.git Make acq.provider_contact.name NOT NULL. This change corrects the effect of a typo (NULL NULL instead of NOT NULL). M Open-ILS/src/sql/Pg/200.schema.acq.sql M Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql A Open-ILS/src/sql/Pg/upgrade/0404.schema.acq-provider-contact-null-null.sql git-svn-id: svn://svn.open-ils.org/ILS/trunk@17733 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql b/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql index d54f3adc6..4f8a956cf 100644 --- a/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql +++ b/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql @@ -17859,6 +17859,9 @@ CREATE INDEX by_heading_and_thesaurus WHERE deleted IS FALSE or deleted = FALSE ; +ALTER TABLE acq.provider_contact + ALTER COLUMN name SET NOT NULL; + COMMIT; -- Some operations go outside of the transaction, because they may diff --git a/Open-ILS/src/sql/Pg/200.schema.acq.sql b/Open-ILS/src/sql/Pg/200.schema.acq.sql index 5144ca561..db632d284 100644 --- a/Open-ILS/src/sql/Pg/200.schema.acq.sql +++ b/Open-ILS/src/sql/Pg/200.schema.acq.sql @@ -106,7 +106,7 @@ CREATE TABLE acq.provider_address ( CREATE TABLE acq.provider_contact ( id SERIAL PRIMARY KEY, provider INT NOT NULL REFERENCES acq.provider (id) DEFERRABLE INITIALLY DEFERRED, - name TEXT NULL NULL, + name TEXT NOT NULL, role TEXT, -- free-form.. e.g. "our sales guy" email TEXT, phone TEXT diff --git a/Open-ILS/src/sql/Pg/upgrade/0404.schema.acq-provider-contact-null-null.sql b/Open-ILS/src/sql/Pg/upgrade/0404.schema.acq-provider-contact-null-null.sql new file mode 100644 index 000000000..d1eeb91c9 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0404.schema.acq-provider-contact-null-null.sql @@ -0,0 +1,11 @@ +BEGIN; + +-- Make this column NOT NULL. This was the intent all along, +-- thwarted by a typo (NULL NULL instead of NOT NULL). + +INSERT INTO config.upgrade_log (version) VALUES ('0404'); -- Scott McKellar + +ALTER TABLE acq.provider_contact + ALTER COLUMN name SET NOT NULL; + +COMMIT;