Skip to content

change_column with {null: false} executes SQL "DROP NOT NULL" #62

@briskt

Description

@briskt

Attempting to change a PostgreSQL column from NULL to NOT NULL. Added the following fizz command to a new migration:

change_column("posts", "destination_id", "integer", {null: false})

Running pop migrate -d produces:

sql - ALTER TABLE "posts" ALTER COLUMN "destination_id" TYPE integer, ALTER COLUMN "destination_id" DROP NOT NULL;```

instead of:

sql - ALTER TABLE "posts" ALTER COLUMN "destination_id" TYPE integer, ALTER COLUMN "destination_id" SET NOT NULL;

Workaround (empty options) is easy, but it seems this should work too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions