mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 12:30:13 +03:00
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:
parent
08e37a4509
commit
088f1da77a
@ -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)
|
||||
|
||||
@ -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')
|
||||
Loading…
x
Reference in New Issue
Block a user