#New migrations added to tauri-plugin-sql not running?

12 messages · Page 1 of 1 (latest)

tranquil valley
#

Hello, i have been using tauri-plugin-sql but recently i updated most of my packages and now with the new versions, i cannot use TauriSql but rather Builder but when i added a new migration to my list of migrations, the new ones don't seem to be running?

tranquil valley
#

@fringe condor any idea here???

fringe condor
#

nope, no idea about sql migrations. Would be helpful if you can come up with a reproduction example for us though

tranquil valley
#

Well I think the right question is how do we handle migrations in this new version, before there were example repo where we could see how the implementations were.

Oh, and am using tauri-plugin-sql with sqlite

fringe condor
#

not sure what you mean with "new version". Nothing changed api wise so the old examples still apply

tranquil valley
#
[dependencies.tauri-plugin-sql]
git = "https://github.com/tauri-apps/tauri-plugin-sql?tag=v0.1.0"
features = ["sqlite"]

This is how I used to use it before, but now it was throwing errors so I upgraded to the one in the documentation. But it doesn't provide support for migration in the new docs found here https://github.com/tauri-apps/tauri-plugin-sql.

The new way is

[dependencies.tauri-plugin-sql]
git = "https://github.com/tauri-apps/plugins-workspace"
branch = "v1"
features = ["sqlite"]
fringe condor
#

ah alright

#

yeah, it's still the same codebase tho

#

just hosted differently

tranquil valley
#

This was one of the PR that was merged into that main repo of tauri-plugin-sql for adding a VueJS example integration.

#

So, this is my current code, but its not running the migrations.

.plugin(
    tauri_plugin_sql::Builder::default()
        .add_migrations(
            "sqlite:inventory_system.db",
            vec![
                Migration {
                    version: 5,
                    description: "added location on inventory table",
                    sql: include_str!("../migrations/5.sql"),
                    kind: MigrationKind::Up,
                },
            ],
        )
        .build(),
)