peewee-db-evolve icon indicating copy to clipboard operation
peewee-db-evolve copied to clipboard

Does not change constraints

Open spraot opened this issue 6 years ago • 3 comments
trafficstars

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.

spraot avatar Apr 12 '19 10:04 spraot

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.

keredson avatar May 09 '19 21:05 keredson

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

spraot avatar May 10 '19 10:05 spraot

+1 going to leave open tho

TODO: implement constraints

keredson avatar May 11 '19 02:05 keredson