add Notification title

This commit is contained in:
Son 2022-01-24 15:18:56 +01:00
parent e73288354d
commit 3422f038eb
2 changed files with 30 additions and 0 deletions

View File

@ -2558,6 +2558,7 @@ class Notification(Base, ModelMixin):
__tablename__ = "notification"
user_id = sa.Column(sa.ForeignKey(User.id, ondelete="cascade"), nullable=False)
message = sa.Column(sa.Text, nullable=False)
title = sa.Column(sa.String(512))
# whether user has marked the notification as read
read = sa.Column(sa.Boolean, nullable=False, default=False)

View File

@ -0,0 +1,29 @@
"""empty message
Revision ID: 07b870d7cc86
Revises: 698424c429e9
Create Date: 2022-01-24 15:00:32.928606
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '07b870d7cc86'
down_revision = '698424c429e9'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('notification', sa.Column('title', sa.String(length=512), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('notification', 'title')
# ### end Alembic commands ###