Added PostgreSQL RDS database. Added channels protected endpoints. Added scripts and docker config to run application locally in dev mode.
Some checks failed
AWS Deploy on Push / build (push) Failing after 41s
Some checks failed
AWS Deploy on Push / build (push) Failing after 41s
This commit is contained in:
18
app/models/db.py
Normal file
18
app/models/db.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from datetime import datetime, timezone
|
||||
from sqlalchemy import Column, String, JSON, DateTime
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
|
||||
Base = declarative_base()
|
||||
|
||||
class ChannelDB(Base):
|
||||
"""SQLAlchemy model for IPTV channels"""
|
||||
__tablename__ = "channels"
|
||||
|
||||
tvg_id = Column(String, primary_key=True)
|
||||
name = Column(String, nullable=False)
|
||||
group_title = Column(String)
|
||||
tvg_name = Column(String)
|
||||
tvg_logo = Column(String)
|
||||
urls = Column(JSON) # Stores list of URLs as JSON
|
||||
created_at = Column(DateTime, default=lambda: datetime.now(timezone.utc))
|
||||
updated_at = Column(DateTime, default=lambda: datetime.now(timezone.utc), onupdate=lambda: datetime.now(timezone.utc))
|
||||
Reference in New Issue
Block a user