File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ use std::sync::{Arc, LazyLock};
1919use tracing:: { info, warn} ;
2020use utoipa:: ToSchema ;
2121
22- pub const CURRENT_SCHEMA_VERSION : i32 = 12 ;
22+ pub const CURRENT_SCHEMA_VERSION : i32 = 11 ;
2323pub const SESSIONS_FOLDER : & str = "sessions" ;
2424pub const DB_NAME : & str = "sessions.db" ;
2525
@@ -1065,16 +1065,6 @@ impl SessionStorage {
10651065 11 => {
10661066 crate :: providers:: inventory:: create_tables_in_tx ( tx) . await ?;
10671067 }
1068- 12 => {
1069- // Add recommended column to provider_inventory_models.
1070- // Ignore error if column already exists (fresh installs
1071- // created the table with the column in migration 11).
1072- let _ = sqlx:: query (
1073- "ALTER TABLE provider_inventory_models ADD COLUMN recommended BOOLEAN" ,
1074- )
1075- . execute ( & mut * * tx)
1076- . await ;
1077- }
10781068 _ => {
10791069 anyhow:: bail!( "Unknown migration version: {}" , version) ;
10801070 }
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Reset the provider inventory tables to empty, as if migration 12 just ran.
3+ # This lets you test the first-use experience (cold inventory).
4+ #
5+ # Usage: ./scripts/reset-inventory.sh
6+
7+ set -euo pipefail
8+
9+ DB=" ${GOOSE_DB:- $HOME / .local/ share/ goose/ sessions/ sessions.db} "
10+
11+ if [ ! -f " $DB " ]; then
12+ echo " Database not found at $DB "
13+ echo " Set GOOSE_DB to override the path."
14+ exit 1
15+ fi
16+
17+ echo " Database: $DB "
18+ echo " "
19+ echo " Before:"
20+ echo " provider_inventory_entries: $( sqlite3 " $DB " ' SELECT COUNT(*) FROM provider_inventory_entries;' ) "
21+ echo " provider_inventory_models: $( sqlite3 " $DB " ' SELECT COUNT(*) FROM provider_inventory_models;' ) "
22+
23+ # ON DELETE CASCADE on provider_inventory_models means deleting entries clears both tables.
24+ # Delete models first since CASCADE isn't reliable in all sqlite3 builds,
25+ # then delete entries.
26+ sqlite3 " $DB " " DELETE FROM provider_inventory_models; DELETE FROM provider_inventory_entries;"
27+
28+ echo " "
29+ echo " After:"
30+ echo " provider_inventory_entries: $( sqlite3 " $DB " ' SELECT COUNT(*) FROM provider_inventory_entries;' ) "
31+ echo " provider_inventory_models: $( sqlite3 " $DB " ' SELECT COUNT(*) FROM provider_inventory_models;' ) "
32+ echo " "
33+ echo " Inventory tables are empty. Restart goose to test first-use flow."
You can’t perform that action at this time.
0 commit comments