18 lines
587 B
Python
18 lines
587 B
Python
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})>" |