You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
1.0 KiB

from .base import Base
from sqlalchemy.orm import Mapped, mapped_column
from sqlalchemy import func
from sqlalchemy import String, Integer, Boolean, ForeignKey, DateTime
from datetime import date, datetime
class Server(Base):
__tablename__ = "easy_servers"
id: Mapped[int] = mapped_column(Integer, primary_key=True)
name:Mapped[str] = mapped_column(String(255), nullable=False, unique=True)
description: Mapped[str | None] = mapped_column(String(1000), nullable=True)
url: Mapped[str] = mapped_column(String(1000), nullable=False, unique=False)
class Database(Base):
__tablename__ = "easy_databases"
id: Mapped[int] = mapped_column(Integer, primary_key=True)
name:Mapped[str] = mapped_column(String(255), nullable=False, unique=True)
description: Mapped[str | None] = mapped_column(String(1000), nullable=True)
date_created: Mapped[datetime | None] = mapped_column(DateTime, nullable=True, default= func.now())
server_id: Mapped[int] = mapped_column(Integer, ForeignKey("easy_servers.id"))