mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-24 18:23:50 +02:00
Small db tables adjustments
This commit is contained in:
parent
d606553e20
commit
f1ecb02160
@ -15,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from sqlalchemy import Column, String
|
from sqlalchemy import Column, String, Integer
|
||||||
|
|
||||||
from .base import BaseTable, GUID
|
from .base import BaseTable, GUID
|
||||||
|
|
||||||
@ -28,6 +28,6 @@ class Compute(BaseTable):
|
|||||||
name = Column(String, index=True)
|
name = Column(String, index=True)
|
||||||
protocol = Column(String)
|
protocol = Column(String)
|
||||||
host = Column(String)
|
host = Column(String)
|
||||||
port = Column(String)
|
port = Column(Integer)
|
||||||
user = Column(String)
|
user = Column(String)
|
||||||
password = Column(String)
|
password = Column(String)
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from sqlalchemy import Table, Column, String, Integer, ForeignKey, BigInteger
|
from sqlalchemy import Table, Column, String, ForeignKey, BigInteger
|
||||||
from sqlalchemy.orm import relationship
|
from sqlalchemy.orm import relationship
|
||||||
|
|
||||||
from .base import Base, BaseTable, GUID
|
from .base import Base, BaseTable, GUID
|
||||||
@ -24,7 +24,7 @@ from .base import Base, BaseTable, GUID
|
|||||||
image_template_link = Table(
|
image_template_link = Table(
|
||||||
"images_templates_link",
|
"images_templates_link",
|
||||||
Base.metadata,
|
Base.metadata,
|
||||||
Column("image_id", Integer, ForeignKey("images.id", ondelete="CASCADE")),
|
Column("image_id", BigInteger, ForeignKey("images.image_id", ondelete="CASCADE")),
|
||||||
Column("template_id", GUID, ForeignKey("templates.template_id", ondelete="CASCADE"))
|
Column("template_id", GUID, ForeignKey("templates.template_id", ondelete="CASCADE"))
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -33,11 +33,11 @@ class Image(BaseTable):
|
|||||||
|
|
||||||
__tablename__ = "images"
|
__tablename__ = "images"
|
||||||
|
|
||||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
image_id = Column(BigInteger, primary_key=True, autoincrement=True)
|
||||||
filename = Column(String)
|
filename = Column(String, index=True)
|
||||||
|
path = Column(String, unique=True)
|
||||||
image_type = Column(String)
|
image_type = Column(String)
|
||||||
image_size = Column(BigInteger)
|
image_size = Column(BigInteger)
|
||||||
path = Column(String, unique=True, index=True)
|
checksum = Column(String, index=True)
|
||||||
checksum = Column(String)
|
|
||||||
checksum_algorithm = Column(String)
|
checksum_algorithm = Column(String)
|
||||||
templates = relationship("Template", secondary=image_template_link, back_populates="images")
|
templates = relationship("Template", secondary=image_template_link, back_populates="images")
|
||||||
|
@ -33,9 +33,9 @@ class Template(BaseTable):
|
|||||||
default_name_format = Column(String)
|
default_name_format = Column(String)
|
||||||
symbol = Column(String)
|
symbol = Column(String)
|
||||||
builtin = Column(Boolean, default=False)
|
builtin = Column(Boolean, default=False)
|
||||||
compute_id = Column(String)
|
|
||||||
usage = Column(String)
|
usage = Column(String)
|
||||||
template_type = Column(String)
|
template_type = Column(String)
|
||||||
|
compute_id = Column(String)
|
||||||
images = relationship("Image", secondary=image_template_link, back_populates="templates")
|
images = relationship("Image", secondary=image_template_link, back_populates="templates")
|
||||||
|
|
||||||
__mapper_args__ = {
|
__mapper_args__ = {
|
||||||
|
Loading…
Reference in New Issue
Block a user