Fix SQL syntax error in ALTER TABLE DEFAULT value
Some checks are pending
CI Pipeline / Run Tests (push) Waiting to run
CI Pipeline / Lint Code (push) Waiting to run
CI Pipeline / Security Scan (push) Waiting to run
CI Pipeline / E2E Tests (push) Blocked by required conditions

This commit is contained in:
Enki 2025-08-27 16:26:42 -07:00
parent 48f18854cc
commit 613b962a87

View File

@ -226,7 +226,7 @@ func (b *Backend) initializeSchema() error {
// Migration: Add storage limit fields to users table // Migration: Add storage limit fields to users table
defaultStorageLimit, _ := b.config.GetDefaultUserStorageLimitBytes() defaultStorageLimit, _ := b.config.GetDefaultUserStorageLimitBytes()
_, err = b.db.Exec(`ALTER TABLE users ADD COLUMN storage_limit INTEGER DEFAULT ?`, defaultStorageLimit) _, err = b.db.Exec(fmt.Sprintf(`ALTER TABLE users ADD COLUMN storage_limit INTEGER DEFAULT %d`, defaultStorageLimit))
if err != nil && !isColumnExistsError(err) { if err != nil && !isColumnExistsError(err) {
return fmt.Errorf("failed to add storage_limit column: %w", err) return fmt.Errorf("failed to add storage_limit column: %w", err)
} }