support cockroachdb.

This commit is contained in:
fiatjaf
2021-07-02 18:32:58 -03:00
parent 2466cd59db
commit ffadce02b0
3 changed files with 33 additions and 15 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ import importlib
import re
import os
from .db import SQLITE, POSTGRES
from .db import SQLITE, POSTGRES, COCKROACH
from .core import db as core_db, migrations as core_migrations
from .helpers import (
get_valid_extensions,
@@ -83,7 +83,7 @@ async def migrate_databases():
exists = await conn.fetchone(
"SELECT * FROM sqlite_master WHERE type='table' AND name='dbversions'"
)
elif conn.type == POSTGRES:
elif conn.type in {POSTGRES, COCKROACH}:
exists = await conn.fetchone(
"SELECT * FROM information_schema.tables WHERE table_name = 'dbversions'"
)