[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, Date, Integer
from sqlalchemy.orm import relationship
from app.extensions import db
class Customer(db.Model):
__tablename__ = 'customers'
__bind_key__ = 'eco'
id = Column(Integer, primary_key=True)
affiliate_code = Column(String(3), nullable=False)
customer_id = Column(String(9), unique=True, nullable=False)
msisdn = Column(String(15), nullable=True)
created_at = Column(Date, nullable=False)
def __repr__(self):
return f"<Customer(id={self.id}, customer_id={self.customer_id}, msisdn={self.msisdn})>"