scale cabinet-mono pack architecture
This commit is contained in:
@@ -4,6 +4,7 @@ from .audit import AuditEvent
|
||||
from .coupons import Coupon, CouponUsage
|
||||
from .gifts import Gift, GiftUsage
|
||||
from .identity import Identity
|
||||
from .identity_notif_prefs import IdentityNotifPref
|
||||
from .identity_session import IdentitySession
|
||||
from .keys import Key
|
||||
from .notifications import Notification, ScheduledBroadcast
|
||||
@@ -31,6 +32,7 @@ __all__ = [
|
||||
"Base",
|
||||
"DictLikeMixin",
|
||||
"Identity",
|
||||
"IdentityNotifPref",
|
||||
"IdentitySession",
|
||||
"User",
|
||||
"ManualBan",
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import (
|
||||
Boolean,
|
||||
Column,
|
||||
DateTime,
|
||||
ForeignKey,
|
||||
PrimaryKeyConstraint,
|
||||
String,
|
||||
)
|
||||
|
||||
from ._base import Base, DictLikeMixin
|
||||
|
||||
|
||||
class IdentityNotifPref(DictLikeMixin, Base):
|
||||
"""Пользовательские настройки каналов доставки уведомлений."""
|
||||
|
||||
__tablename__ = "identity_notif_prefs"
|
||||
|
||||
identity_id = Column(
|
||||
String(36),
|
||||
ForeignKey("identities.id", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
)
|
||||
channel = Column(String(32), nullable=False)
|
||||
enabled = Column(Boolean, nullable=False, default=True)
|
||||
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, nullable=False)
|
||||
|
||||
__table_args__ = (
|
||||
PrimaryKeyConstraint("identity_id", "channel"),
|
||||
)
|
||||
Reference in New Issue
Block a user