Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/dstack/_internal/server/alembic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ script_location = migrations
# Uncomment the line below if you want the files to be prepended with date and time
# see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
# for all available tokens
# file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
file_template = %%(year)d/%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d_%%(rev)s_%%(slug)s

# sys.path path, will be prepended to sys.path if present.
# defaults to the current working directory.
Expand All @@ -20,7 +20,7 @@ prepend_sys_path = .
# installed by adding `alembic[tz]` to the pip requirements
# string value is passed to dateutil.tz.gettz()
# leave blank for localtime
# timezone =
timezone = utc

# max length of characters to apply to the
# "slug" field
Expand Down Expand Up @@ -50,7 +50,7 @@ path_separator = os
# set to 'true' to search source files recursively
# in each "version_locations" directory
# new in Alembic version 1.10
# recursive_version_locations = false
recursive_version_locations = true

# the output encoding used when revision files
# are written from script.py.mako
Expand Down
1 change: 1 addition & 0 deletions src/dstack/_internal/server/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,6 @@ async def sqlite_commit(session: AsyncSession):
def _run_alembic_upgrade(connection):
alembic_cfg = config.Config()
alembic_cfg.set_main_option("script_location", settings.ALEMBIC_MIGRATIONS_LOCATION)
alembic_cfg.set_main_option("recursive_version_locations", "true")
alembic_cfg.attributes["connection"] = connection
command.upgrade(alembic_cfg, "head")
2 changes: 1 addition & 1 deletion src/dstack/_internal/server/migrations/script.py.mako
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Create Date: ${create_date}

"""

from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
from alembic import op

import dstack._internal.server.models
${imports if imports else ""}
Expand Down