Skip to content

Commit

Permalink
gettin' somewhere!
Browse files Browse the repository at this point in the history
  • Loading branch information
Erutis committed Aug 29, 2024
1 parent 899dcee commit c4fd159
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion migrations/env.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from logging.config import fileConfig

from sqlalchemy import create_engine
from sqlalchemy import create_engine, text
from sqlalchemy.schema import CreateSchema

from alembic import context
Expand Down Expand Up @@ -75,6 +75,8 @@ def run_migrations_online() -> None:
for schema in SCHEMATA:
if not engine.dialect.has_schema(connection, schema):
connection.execute(CreateSchema(schema))
connection.execute(text("CREATE EXTENSION IF NOT EXISTS postgis;"))
connection.execute(text("SELECT postgis_full_version();"))

with context.begin_transaction():
context.run_migrations()
Expand Down

0 comments on commit c4fd159

Please sign in to comment.