15 lines
569 B
Python
15 lines
569 B
Python
# app/models/admin.py
|
|
from sqlalchemy import Column, Integer, String, DateTime
|
|
from sqlalchemy.sql import func
|
|
from app.database import Base
|
|
|
|
|
|
class Admin(Base):
|
|
__tablename__ = "admins"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
username = Column(String(50), unique=True, index=True, nullable=False)
|
|
password_hash = Column(String(255), nullable=False)
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
updated_at = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now())
|