feat: add configurable user statistics
This commit is contained in:
@@ -128,6 +128,7 @@ CREATE TABLE IF NOT EXISTS managed_keys (
|
||||
route_mode TEXT NOT NULL CHECK(route_mode IN ('auto', 'strict')),
|
||||
upstream_account_id TEXT NOT NULL DEFAULT '',
|
||||
all_models INTEGER NOT NULL DEFAULT 1,
|
||||
show_in_stats INTEGER NOT NULL DEFAULT 1,
|
||||
created_at TEXT NOT NULL,
|
||||
updated_at TEXT NOT NULL
|
||||
);
|
||||
@@ -292,6 +293,7 @@ func OpenSQLiteUsage(databasePath string) (*SQLiteUsageRepository, error) {
|
||||
`ALTER TABLE model_prices ADD COLUMN source_fetched_at TEXT NOT NULL DEFAULT ''`,
|
||||
`ALTER TABLE billing_accounts ADD COLUMN lifetime_spent_micros INTEGER NOT NULL DEFAULT 0`,
|
||||
`ALTER TABLE upstream_accounts ADD COLUMN current INTEGER NOT NULL DEFAULT 1`,
|
||||
`ALTER TABLE managed_keys ADD COLUMN show_in_stats INTEGER NOT NULL DEFAULT 1`,
|
||||
} {
|
||||
if _, err := db.Exec(migration); err != nil && !strings.Contains(strings.ToLower(err.Error()), "duplicate column") {
|
||||
_ = db.Close()
|
||||
|
||||
Reference in New Issue
Block a user