From b06c0a87513913bed204aa6c9985d594730fdf61 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Thu, 27 Mar 2025 16:15:51 +0000 Subject: [PATCH] Add Country model --- models/country.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 models/country.py diff --git a/models/country.py b/models/country.py new file mode 100644 index 0000000..7401604 --- /dev/null +++ b/models/country.py @@ -0,0 +1,16 @@ +from sqlalchemy import Column, String, DateTime +from sqlalchemy.sql import func +from core.database import Base +import uuid + +class Country(Base): + __tablename__ = "countries" + + id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4())) + name = Column(String, unique=True, nullable=False, index=True) + code = Column(String(2), unique=True, nullable=False) + currency = Column(String, nullable=True) + capital = Column(String, nullable=True) + region = Column(String, nullable=True) + created_at = Column(DateTime, default=func.now()) + updated_at = Column(DateTime, default=func.now(), onupdate=func.now()) \ No newline at end of file