Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migration on changed includedPropertyNames for IsGeneratedTsVectorColumn creates up/down code in wrong order #3134

Open
springy76 opened this issue Mar 21, 2024 · 0 comments

Comments

@springy76
Copy link

springy76 commented Mar 21, 2024

My entity setup has this code:

entityBuilder.Property<NpgsqlTsVector>(AllTextColumnsFullTextComputedColumnName) .IsGeneratedTsVectorColumn(FullTextDictionaryName, FieldsIncludedInFullTextColumn);

where FieldsIncludedInFullTextColumn is a string[].

Now I added a new string property to the entity and added the name as the last entry to FieldsIncludedInFullTextColumn.

Now the migration created by add-migration powershell script does this in Up method:

  1. migrationBuilder.AlterColumn<NpgsqlTsVector>(... // referencing column name of step2
  2. migrationBuilder.AddColumn<string>(...

And so the resulting SQL is also in wrong order:

  1. drop tsvector column
  2. recreate tsvector column referencing column which gets created in step 3
  3. create text column needed for step 2

Same problem with Down method, just in inverse order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant