Skip to content

Alter table remove column migration removes primary key #38

@pasibonfire

Description

@pasibonfire

Expected Behavior

Removing a column should remove only the column.
If the removed column is primary key, only then the constraint should be deleted.

Current Behavior

Migration that removes a column (or rollback for add column) removes the primary key constraint from the table.

Possible Solution

Adding primary_key: false doesn't remove the constraint. If this is expected behaviour, there is no documentation about it.

Steps to Reproduce (for bugs)

  1. Clone https://github.com/pasibonfire/mssql_ecto.git
  2. Checkout branch fix_remove_column
  3. Run docker-compose build
  4. Run docker-compose run mssql_ecto mix test

Context

Your Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions