LP#1737019: (follow-up) fix issue in schema update
authorGalen Charlton <gmc@equinoxOLI.org>
Tue, 21 Sep 2021 14:10:38 +0000 (10:10 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Tue, 21 Sep 2021 14:10:38 +0000 (10:10 -0400)
Looks like 'SET DEFAULT ...' and 'SET NOT NULL' cannot be
combined in a single ALTER TABLE statement.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Open-ILS/src/sql/Pg/upgrade/XXXX.schema.acq-active-flag.sql

index 4a5aeee..fce1555 100644 (file)
@@ -8,6 +8,7 @@ ALTER TABLE acq.funding_source ADD COLUMN active BOOL;
 
 UPDATE acq.funding_source SET active = 't';
 
-ALTER TABLE acq.funding_source ALTER COLUMN active SET NOT NULL DEFAULT TRUE;
+ALTER TABLE acq.funding_source ALTER COLUMN active SET DEFAULT TRUE;
+ALTER TABLE acq.funding_source ALTER COLUMN active SET NOT NULL;
 
-COMMIT;
\ No newline at end of file
+COMMIT;