I am using Microsoft.EntityFrameworkCore 3.1.8 with my UWP app.
I need to run this sqlite query using Entity framework core and Code first approach:
CREATE VIRTUAL TABLE TrialFTS USING fts5(search, tokenize="trigram");
This gets executed in sqlite database directly without any errors and works fine.
But when I use it inside the migration:
public partial class FTSFirstMigration : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("CREATE VIRTUAL TABLE ProductFTS USING fts5(search, tokenize=\"trigram\");");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ProductFTS");
}
}
It fails and throws the error: SQLite Error 1: 'no such tokenizer: trigram'
How to solve this? How to load this tokenizer module explicitly to the sqlite database?