mirror of
https://github.com/simple-login/app.git
synced 2025-02-23 15:23:27 +08:00
add Notification title
This commit is contained in:
parent
e73288354d
commit
3422f038eb
2 changed files with 30 additions and 0 deletions
|
@ -2558,6 +2558,7 @@ class Notification(Base, ModelMixin):
|
||||||
__tablename__ = "notification"
|
__tablename__ = "notification"
|
||||||
user_id = sa.Column(sa.ForeignKey(User.id, ondelete="cascade"), nullable=False)
|
user_id = sa.Column(sa.ForeignKey(User.id, ondelete="cascade"), nullable=False)
|
||||||
message = sa.Column(sa.Text, nullable=False)
|
message = sa.Column(sa.Text, nullable=False)
|
||||||
|
title = sa.Column(sa.String(512))
|
||||||
|
|
||||||
# whether user has marked the notification as read
|
# whether user has marked the notification as read
|
||||||
read = sa.Column(sa.Boolean, nullable=False, default=False)
|
read = sa.Column(sa.Boolean, nullable=False, default=False)
|
||||||
|
|
29
migrations/versions/2022_012415_07b870d7cc86_.py
Normal file
29
migrations/versions/2022_012415_07b870d7cc86_.py
Normal 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 ###
|
Loading…
Reference in a new issue