fizz icon indicating copy to clipboard operation
fizz copied to clipboard

change_column doesn't support {"default": null}

Open briskt opened this issue 5 years ago • 1 comments

I need to change a column in a PostgresQL database from kilograms numeric(13,4) DEFAULT '0'::numeric NOT NULL TO kilograms numeric(13,4)

To do this, I created a fizz migration containing

change_column("posts", "kilograms", "numeric(13,4)", {"default": null,"null": true})

but it fails with

error processing migrations/20200210151102_post_kilograms_nullable.up.fizz: could not fizz the migration migrations/20200210151102_post_kilograms_nullable.up.fizz: line 0: "null": unknown identifier

If I leave off the "default": null the previous default remains, which is not what I want. I also tried "default": "null" but that didn't work either.

briskt avatar Feb 10 '20 16:02 briskt

DROP DEFAULT is not currently supported.

sio4 avatar Sep 07 '22 11:09 sio4