[feat]: add models bind to eco database
This commit is contained in:
@@ -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})>"
|
||||
Reference in New Issue
Block a user