fix: mtls for agent, problems with auth
This commit is contained in:
@@ -15,6 +15,12 @@ const CreateSqlite = `
|
||||
);
|
||||
`
|
||||
|
||||
// AddIsActiveColumn adds is_active column to tokens table if it doesn't exist.
|
||||
// This is a migration for existing databases that don't have this column.
|
||||
const AddIsActiveColumn = `
|
||||
ALTER TABLE tokens ADD COLUMN is_active BOOL NOT NULL DEFAULT 0
|
||||
`
|
||||
|
||||
const CreateRegistrationTokensTable = `
|
||||
CREATE TABLE IF NOT EXISTS registration_tokens (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
|
||||
@@ -36,5 +36,8 @@ func Open(path string) (*sql.DB, error) {
|
||||
return nil, fmt.Errorf("migrate: %w", err)
|
||||
}
|
||||
|
||||
// Migration: add is_active column if it doesn't exist
|
||||
_, _ = db.Exec(AddIsActiveColumn)
|
||||
|
||||
return db, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user