docker: persist extra_configs in the template DB table

The extra_configs schema field needs a column on the docker_templates table
to actually round-trip through the controller DB (the schema alone is
accepted but dropped by the SQLAlchemy model mapping). Add the JSON column
and an Alembic migration so existing databases get it on upgrade.
This commit is contained in:
YueGuobin 2026-08-14 00:20:08 +08:00
parent 08e37a4509
commit 088f1da77a
No known key found for this signature in database
2 changed files with 27 additions and 0 deletions

View File

@ -78,6 +78,7 @@ class DockerTemplate(Template):
console_resolution = Column(String)
extra_hosts = Column(String)
extra_volumes = Column(JSON)
extra_configs = Column(JSON)
memory = Column(Integer)
cpus = Column(Float)
custom_adapters = Column(JSON)

View File

@ -0,0 +1,26 @@
"""add extra_configs to docker templates table
Revision ID: 8f2a1c4e9d3b
Revises: f0b0de2a9
Create Date: 2026-08-14 10:00:00.000000
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8f2a1c4e9d3b'
down_revision = 'f0b0de2a9'
branch_labels = None
depends_on = None
def upgrade() -> None:
op.add_column('docker_templates', sa.Column('extra_configs', sa.JSON()))
def downgrade() -> None:
op.drop_column('docker_templates', 'extra_configs')