Add production support for SQLite
This commit is contained in:
1 parent
3918a2ac71
commit
9da68a9625
11 files changed
+486
-20
No files matched your search
@@ -4,6 +4,9 @@ RUN_IN_TRANSACTION = True
|
||||
|
||||
|
||||
async def upgrade(db: BaseDBAsyncClient) -> str:
|
||||
# Migration 0 bootstraps SQLite at the current schema.
|
||||
if db.capabilities.dialect == "sqlite":
|
||||
return "SELECT 1;"
|
||||
return """
|
||||
CREATE TABLE IF NOT EXISTS "ocsp_snapshot" (
|
||||
"ca_id" UUID NOT NULL PRIMARY KEY,
|
||||
@@ -17,6 +20,8 @@ COMMENT ON TABLE "ocsp_snapshot" IS 'Publication state for one CA''s OCSP status
|
||||
|
||||
|
||||
async def downgrade(db: BaseDBAsyncClient) -> str:
|
||||
if db.capabilities.dialect == "sqlite":
|
||||
return "SELECT 1;"
|
||||
return """
|
||||
DROP TABLE IF EXISTS "ocsp_snapshot";"""
|
||||
|
||||
|
||||
Reference in new issue
Block a user