Skip to content

CompositeType.Operation will create current type definition, not historical definition #8

Open
@mx-moth

Description

@mx-moth

The current implementation of CompositeType.Operation will create the type as it is when the migration is run, not as the type was when the migration was created. This can lead to problems when changing the type later, and making a migration for it. Consider the following scenario:

  1. A type is created with two fields.
  2. A migration is made that creates this type
  3. The migrations are run
  4. A new field is added to the type
  5. A new migration is created to add this new field to the type
  6. The migrations are run

This will work. However, for someone making a new database from scratch, this will fail. The type will be created with all three fields in the first migration, and the second migration will fail to add the duplicate field.

The creation migration should save the state of the type at the time the migration is created, rather than the time the migration is run.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions