Set the column to "NOT NULL DEFAULT FALSE" and remove the extra
updates to set the current columsn to FALSE and add the NOT NULL
constraint. This new version does it all in 1 ALTER TABLE statement.
Signed-off-by: Jason Stephenson <jstephenson@cwmars.org>
BEGIN;
-ALTER TABLE permission.grp_tree ADD COLUMN erenew BOOL;
-
-COMMIT;
-
-BEGIN;
-
-UPDATE permission.grp_tree SET erenew = FALSE;
-
-COMMIT;
-
-BEGIN;
-
-ALTER TABLE permission.grp_tree ALTER COLUMN erenew SET NOT NULL;
+ALTER TABLE permission.grp_tree ADD COLUMN erenew BOOL NOT NULL DEFAULT FALSE;
COMMIT;