Telezab/app/models/subscriptions.py
UdoChudo 52e31864b3 feat: Develop web interface
- Implemented the initial version of the web interface.
refactor: Begin Telegram bot refactoring
- Started restructuring the bot’s code for better maintainability.
chore: Migrate to Flask project structure
- Reorganized the application to follow Flask's project structure.
cleanup: Extensive code cleanup
- Removed redundant code and improved readability.

Signed-off-by: UdoChudo <stream@udochudo.ru>
2025-06-10 14:39:11 +05:00

13 lines
569 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from sqlalchemy import ForeignKey, PrimaryKeyConstraint
from app.extensions.db import db
class Subscriptions(db.Model):
chat_id = db.Column(db.Integer, ForeignKey('users.chat_id', ondelete='CASCADE'), nullable=False) #Добавляем внешний ключ с ondelete
region_id = db.Column(db.Integer, nullable=False)
active = db.Column(db.Boolean, default=True)
skip = db.Column(db.Boolean, default=False)
disaster_only = db.Column(db.Boolean, default=False)
__table_args__ = (
PrimaryKeyConstraint('chat_id', 'region_id'),
)