mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Convert database template fields from PickleType to JSON
This commit is contained in:
2 files changed
+143
-9
No files matched your search
@@ -16,7 +16,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from sqlalchemy import Boolean, Column, String, Integer, Float, ForeignKey, PickleType, JSON
|
||||
from sqlalchemy import Boolean, Column, String, Integer, Float, ForeignKey, JSON
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from .base import BaseTable, generate_uuid, GUID
|
||||
@@ -51,7 +51,7 @@ class CloudTemplate(Template):
|
||||
__tablename__ = "cloud_templates"
|
||||
|
||||
template_id = Column(GUID, ForeignKey("templates.template_id", ondelete="CASCADE"), primary_key=True)
|
||||
ports_mapping = Column(PickleType)
|
||||
ports_mapping = Column(JSON)
|
||||
remote_console_host = Column(String)
|
||||
remote_console_port = Column(Integer)
|
||||
remote_console_type = Column(String)
|
||||
@@ -77,10 +77,10 @@ class DockerTemplate(Template):
|
||||
console_http_path = Column(String)
|
||||
console_resolution = Column(String)
|
||||
extra_hosts = Column(String)
|
||||
extra_volumes = Column(PickleType)
|
||||
extra_volumes = Column(JSON)
|
||||
memory = Column(Integer)
|
||||
cpus = Column(Float)
|
||||
custom_adapters = Column(PickleType)
|
||||
custom_adapters = Column(JSON)
|
||||
|
||||
__mapper_args__ = {"polymorphic_identity": "docker", "polymorphic_load": "selectin"}
|
||||
|
||||
@@ -133,7 +133,7 @@ class EthernetHubTemplate(Template):
|
||||
__tablename__ = "ethernet_hub_templates"
|
||||
|
||||
template_id = Column(GUID, ForeignKey("templates.template_id", ondelete="CASCADE"), primary_key=True)
|
||||
ports_mapping = Column(PickleType)
|
||||
ports_mapping = Column(JSON)
|
||||
|
||||
__mapper_args__ = {"polymorphic_identity": "ethernet_hub", "polymorphic_load": "selectin"}
|
||||
|
||||
@@ -143,7 +143,7 @@ class EthernetSwitchTemplate(Template):
|
||||
__tablename__ = "ethernet_switch_templates"
|
||||
|
||||
template_id = Column(GUID, ForeignKey("templates.template_id", ondelete="CASCADE"), primary_key=True)
|
||||
ports_mapping = Column(PickleType)
|
||||
ports_mapping = Column(JSON)
|
||||
console_type = Column(String)
|
||||
|
||||
__mapper_args__ = {"polymorphic_identity": "ethernet_switch", "polymorphic_load": "selectin"}
|
||||
@@ -211,7 +211,7 @@ class QemuTemplate(Template):
|
||||
cpu_throttling = Column(Integer)
|
||||
process_priority = Column(String)
|
||||
options = Column(String)
|
||||
custom_adapters = Column(PickleType)
|
||||
custom_adapters = Column(JSON)
|
||||
|
||||
__mapper_args__ = {"polymorphic_identity": "qemu", "polymorphic_load": "selectin"}
|
||||
|
||||
@@ -234,7 +234,7 @@ class VirtualBoxTemplate(Template):
|
||||
on_close = Column(String)
|
||||
console_type = Column(String)
|
||||
console_auto_start = Column(Boolean)
|
||||
custom_adapters = Column(PickleType)
|
||||
custom_adapters = Column(JSON)
|
||||
|
||||
__mapper_args__ = {"polymorphic_identity": "virtualbox", "polymorphic_load": "selectin"}
|
||||
|
||||
@@ -256,7 +256,7 @@ class VMwareTemplate(Template):
|
||||
on_close = Column(String)
|
||||
console_type = Column(String)
|
||||
console_auto_start = Column(Boolean)
|
||||
custom_adapters = Column(PickleType)
|
||||
custom_adapters = Column(JSON)
|
||||
|
||||
__mapper_args__ = {"polymorphic_identity": "vmware", "polymorphic_load": "selectin"}
|
||||
|
||||
|
||||
Reference in new issue
Block a user