fordfrog / apgdiff

Another PostgreSQL Diff Tool
http://www.apgdiff.com
MIT License
353 stars 138 forks source link

DROP NOT NULL with DEFAULT #253

Open mamonovd opened 5 years ago

mamonovd commented 5 years ago

Drop both "NOT NULL" and "DEFAULT" on table column. Switch order of parseDefinition patterns apply, otherwise column which has both "NOT NULL" and "DEFAULT" can't be modified to have none of them.

oldColumn: column_name column_type NOT NULL DEFAULT default_value newColumn: column_name column_type diff (v2.6.0): _ALTER TABLE... ALTER COLUMN column_name columntype, ALTER COLUMN DROP DEFAULT;

but should be: ALTER TABLE... ALTER COLUMN DROP NOT NULL, ALTER COLUMN DROP DEFAULT;