import datetime

from sqlalchemy import Column, DateTime, String, Integer, ForeignKey, Boolean

from app.domain.models.base import BaseModel


class Backup(BaseModel):
    __tablename__ = 'backups'

    timestamp = Column(DateTime, nullable=False, default=datetime.datetime.now)
    path = Column(String, nullable=False)
    filename = Column(String, nullable=False)
    is_by_user = Column(Boolean, nullable=False, default=False)

    user_id = Column(Integer, ForeignKey('users.id'), nullable=False)
