mirror of
https://github.com/sartography/protocol-builder-mock.git
synced 2025-01-12 00:34:44 +00:00
Added table selected_user for ticket 319.
We now store a user's selected_user so they see a filtered list of studies when returning to the PB Mock homepage
This commit is contained in:
parent
5fa0ae8958
commit
688023a248
28
migrations/versions/6c34576847ab_.py
Normal file
28
migrations/versions/6c34576847ab_.py
Normal file
@ -0,0 +1,28 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 6c34576847ab
|
||||
Revises: c14ddab2e6ca
|
||||
Create Date: 2021-05-11 11:10:14.725089
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '6c34576847ab'
|
||||
down_revision = 'c14ddab2e6ca'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table('selected_user',
|
||||
sa.Column('user_id', sa.String(), nullable=False),
|
||||
sa.Column('selected_user', sa.String(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('user_id')
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('selected_user')
|
12
pb/models.py
12
pb/models.py
@ -281,9 +281,19 @@ class StudyDetails(db.Model):
|
||||
REVIEWTYPENAME = db.Column(db.String, nullable=True)
|
||||
|
||||
|
||||
|
||||
class StudyDetailsSchema(ma.SQLAlchemyAutoSchema):
|
||||
class Meta:
|
||||
model = StudyDetails
|
||||
load_instance = True
|
||||
include_relationships = False
|
||||
|
||||
|
||||
class SelectedUser(db.Model):
|
||||
user_id = db.Column(db.String(), primary_key=True)
|
||||
selected_user = db.Column(db.String(), nullable=True)
|
||||
|
||||
|
||||
class SelectedUserSchema(ma.Schema):
|
||||
class Meta:
|
||||
fields = ("user_id", "selected_user")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user