How to create a fulltext catalog in an entity framework database migration?

1.9k Views Asked by At

I'm trying to create a fulltext catalog on a entity framework migration but if I do a migration with:

migrationBuilder.Sql("CREATE FULLTEXT CATALOG[CatalogName]");

I get the following:

CREATE FULLTEXT CATALOG statement cannot be used inside a user transaction.

If I try to do it at the seed function I get the same result. I've searched about this and all issues I found the author either decided to do it manually on the DB or some other solution that is not applicable to me.

Any ideas on how I may get this to work?

1

There are 1 best solutions below

1
On BEST ANSWER

Now I feel dumb. I didn't notice that Sql() function has an optional parameter to suppress the transaction :\ Passing true ended up solving my problem.