uploader-bot/app/core/models/promo.py

17 lines
688 B
Python

from .base import AlchemyBase
from sqlalchemy import Column, BigInteger, Integer, String, ForeignKey, DateTime, JSON, Boolean
from datetime import datetime
class PromoAction(AlchemyBase):
__tablename__ = 'promo_actions'
id = Column(Integer, autoincrement=True, primary_key=True)
user_id = Column(String(512), nullable=False)
user_internal_id = Column(Integer, ForeignKey('users.id'), nullable=True)
action_type = Column(String(64), nullable=False) # Type of action, e.g., 'referral', 'discount'
action_ref = Column(String(512), nullable=False) # Reference to the action, e.g., promo code
created = Column(DateTime, nullable=False, default=datetime.now)