first commit
This commit is contained in:
19
backend/app/models/backup.py
Normal file
19
backend/app/models/backup.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from sqlalchemy import Column, DateTime, ForeignKey, Integer, String
|
||||
from sqlalchemy.orm import relationship
|
||||
from sqlalchemy.sql import func
|
||||
|
||||
from app.db.session import Base
|
||||
|
||||
|
||||
class Backup(Base):
|
||||
__tablename__ = "backups"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
router_id = Column(Integer, ForeignKey("routers.id"), nullable=False, index=True)
|
||||
file_path = Column(String(500), nullable=False)
|
||||
file_name = Column(String(255), nullable=False)
|
||||
backup_type = Column(String(50), nullable=False, default="export")
|
||||
checksum = Column(String(64), nullable=True)
|
||||
created_at = Column(DateTime, server_default=func.now(), nullable=False)
|
||||
|
||||
router = relationship("Router", back_populates="backups")
|
||||
Reference in New Issue
Block a user