Add Hotel model
This commit is contained in:
parent
465239e52b
commit
49bb870948
28
models/hotel.py
Normal file
28
models/hotel.py
Normal file
@ -0,0 +1,28 @@
|
||||
from sqlalchemy import Column, String, Integer, Boolean, DateTime, Float, Text
|
||||
from sqlalchemy.orm import relationship
|
||||
from sqlalchemy.sql import func
|
||||
from core.database import Base
|
||||
import uuid
|
||||
|
||||
class Hotel(Base):
|
||||
__tablename__ = "hotels"
|
||||
|
||||
id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4()))
|
||||
name = Column(String, nullable=False, index=True)
|
||||
description = Column(Text)
|
||||
location = Column(String, nullable=False)
|
||||
address = Column(String, nullable=False)
|
||||
rating = Column(Float, nullable=False)
|
||||
price_per_night = Column(Float, nullable=False)
|
||||
amenities = Column(Text)
|
||||
images = Column(Text)
|
||||
contact_number = Column(String)
|
||||
email = Column(String)
|
||||
website = Column(String)
|
||||
total_rooms = Column(Integer)
|
||||
is_active = Column(Boolean, default=True)
|
||||
latitude = Column(Float)
|
||||
longitude = Column(Float)
|
||||
|
||||
created_at = Column(DateTime, default=func.now())
|
||||
updated_at = Column(DateTime, default=func.now(), onupdate=func.now())
|
Loading…
x
Reference in New Issue
Block a user