from sqlalchemy.orm import relationship

from app.extensions.db import db

class Users(db.Model):
    chat_id = db.Column(db.Integer, primary_key=True)
    telegram_id = db.Column(db.String(80), unique=True, nullable=False)
    user_email = db.Column(db.String(255), unique=True, nullable=False)
    is_blocked = db.Column(db.Boolean, default=False)
    subscriptions = relationship("Subscriptions", backref="user", cascade="all, delete-orphan") # Добавлено cascade