[feat]: add models bind to eco database

This commit is contained in:
VivianDee
2025-07-25 15:13:59 +01:00
parent 8c215a7f35
commit 5c99bf96c2
6 changed files with 122 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
from sqlalchemy import Column, String, DateTime, Integer
from app.extensions import db
class Session(db.Model):
__tablename__ = 'sessions'
__bind_key__ = 'eco'
id = Column(Integer, primary_key=True)
session_id = Column(String(50), unique=True, nullable=False)
customer_id = Column(String(9), nullable=True)
account_id = Column(String(10), nullable=True)
msisdn = Column(String(15), nullable=False)
channel = Column(String(10), nullable=False)
expires_at = Column(DateTime, nullable=False)
status = Column(String(20), default='ACTIVE')
def __repr__(self):
return f"<Session(id={self.id}, session_id={self.session_id}, status={self.status})>"