keredson / peewee-db-evolve

Automatic migrations for the Peewee ORM.
GNU Lesser General Public License v3.0
128 stars 26 forks source link

Does not change constraints #35

Open spraot opened 5 years ago

spraot commented 5 years ago

I changed the constraints in a table so that this column: check ((hosting)::text = ANY (ARRAY[('Cloud'::character varying)::text, ('Server'::character varying)::text])), should change to: check ((hosting)::text = ANY (ARRAY[('Cloud'::character varying)::text, ('Server'::character varying)::text, ('Data Center'::character varying)::text])),

Using the constraints=[Check(...))] syntax in peewee. However, when running the migration, the constraint is not changed.

keredson commented 5 years ago

hey @rachetfoot,

peewee-db-evolve has never had constraint evolution implemented. (i don't recall it existing when i wrote this - was this new to peewee3?) i'd be all for a PR tho - shouldn't be too hard, i assume just a drop and replace call like the indexes, as peewee can obviously gen the appropriate SQL.

spraot commented 5 years ago

I'm not on peewee3, so I don't think so. I ended up just removing the constraints since they weren't necessary anyway.

keredson commented 5 years ago

+1 going to leave open tho

TODO: implement constraints