Skip to content

Commit 5d07c8e

Browse files
codinger41[Arusey]
authored and
[Arusey]
committed
feat(notifications): setup notific ations
- add new model for adminnotifications [Delivers CON-71]
1 parent d48710c commit 5d07c8e

File tree

6 files changed

+39
-25
lines changed

6 files changed

+39
-25
lines changed

.coveragerc

Lines changed: 0 additions & 17 deletions
This file was deleted.
File renamed without changes.

alembic/env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
from api.response.models import Response
4646
from api.tag.models import Tag
4747
from api.structure.models import Structure
48-
48+
from admin_notifications.models import AdminNotification
4949

5050
target_metadata = Base.metadata
5151

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
"""add admin notifications table
2+
3+
Revision ID: c65718cd4ed8
4+
Revises: a5a4841351d7
5+
Create Date: 2019-06-21 08:38:07.110402
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
11+
12+
# revision identifiers, used by Alembic.
13+
revision = 'c65718cd4ed8'
14+
down_revision = 'a5a4841351d7'
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
# ### commands auto generated by Alembic - please adjust! ###
21+
op.create_table('admin_notifications',
22+
sa.Column('id', sa.Integer(), nullable=False),
23+
sa.Column('title', sa.String(), nullable=True),
24+
sa.Column('message', sa.String(), nullable=True),
25+
sa.Column('date_received', sa.String(), nullable=True),
26+
sa.Column('date_read', sa.String(), nullable=True),
27+
sa.Column('status', sa.Enum('read', 'unread', name='statustype'), nullable=True),
28+
sa.Column('location_id', sa.Integer(), nullable=True),
29+
sa.ForeignKeyConstraint(['location_id'], ['locations.id'], ondelete='CASCADE'),
30+
sa.PrimaryKeyConstraint('id')
31+
)
32+
# ### end Alembic commands ###
33+
34+
35+
def downgrade():
36+
# ### commands auto generated by Alembic - please adjust! ###
37+
op.drop_table('admin_notifications')
38+
# ### end Alembic commands ###

setup.cfg

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)