diff --git a/internal/pkg/storage/sqlite.go b/internal/pkg/storage/sqlite.go index 9f91f5e..59af8e0 100755 --- a/internal/pkg/storage/sqlite.go +++ b/internal/pkg/storage/sqlite.go @@ -64,11 +64,7 @@ renew_before INTEGER DEFAULT 0 ); -- Add ALTER TABLE statement for existing databases to add the full_chain_pem column - -- This must be separate as ALTER TABLE IF NOT EXISTS ADD COLUMN is not universally supported in SQLite for BLOB. - -- A simpler approach is to just try adding and ignore the error if it exists, as InitSchema does. - -- However, for robustness, we check for column existence first. PRAGMA foreign_keys = OFF; -- Disable foreign key checks for schema modification - INSERT OR IGNORE INTO sqlite_master (type, name, tbl_name, rootpage, sql) VALUES ('table', 'certificates', 'certificates', 0, 'CREATE TABLE certificates (domain TEXT PRIMARY KEY, email TEXT NOT NULL, cert_pem BLOB NOT NULL, key_pem BLOB NOT NULL, full_chain_pem BLOB DEFAULT '', account_key BLOB NOT NULL, account_url TEXT NOT NULL, issuer_type TEXT DEFAULT '', secret_name TEXT DEFAULT '', updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, enable_rotation BOOLEAN DEFAULT 0, renew_before INTEGER DEFAULT 0)'); ALTER TABLE certificates ADD COLUMN full_chain_pem BLOB DEFAULT ''; PRAGMA foreign_keys = ON; -- Re-enable foreign key checks