mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-04 12:04:12 +00:00
Small db tables adjustments
This commit is contained in:
parent
d606553e20
commit
f1ecb02160
gns3server/db/models
@ -15,7 +15,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# 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
|
||||
|
||||
@ -28,6 +28,6 @@ class Compute(BaseTable):
|
||||
name = Column(String, index=True)
|
||||
protocol = Column(String)
|
||||
host = Column(String)
|
||||
port = Column(String)
|
||||
port = Column(Integer)
|
||||
user = Column(String)
|
||||
password = Column(String)
|
||||
|
@ -15,7 +15,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# 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 .base import Base, BaseTable, GUID
|
||||
@ -24,7 +24,7 @@ from .base import Base, BaseTable, GUID
|
||||
image_template_link = Table(
|
||||
"images_templates_link",
|
||||
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"))
|
||||
)
|
||||
|
||||
@ -33,11 +33,11 @@ class Image(BaseTable):
|
||||
|
||||
__tablename__ = "images"
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
filename = Column(String)
|
||||
image_id = Column(BigInteger, primary_key=True, autoincrement=True)
|
||||
filename = Column(String, index=True)
|
||||
path = Column(String, unique=True)
|
||||
image_type = Column(String)
|
||||
image_size = Column(BigInteger)
|
||||
path = Column(String, unique=True, index=True)
|
||||
checksum = Column(String)
|
||||
checksum = Column(String, index=True)
|
||||
checksum_algorithm = Column(String)
|
||||
templates = relationship("Template", secondary=image_template_link, back_populates="images")
|
||||
|
@ -33,9 +33,9 @@ class Template(BaseTable):
|
||||
default_name_format = Column(String)
|
||||
symbol = Column(String)
|
||||
builtin = Column(Boolean, default=False)
|
||||
compute_id = Column(String)
|
||||
usage = Column(String)
|
||||
template_type = Column(String)
|
||||
compute_id = Column(String)
|
||||
images = relationship("Image", secondary=image_template_link, back_populates="templates")
|
||||
|
||||
__mapper_args__ = {
|
||||
|
Loading…
Reference in New Issue
Block a user