Skip to content

Commit

Permalink
update migration files (#2097)
Browse files Browse the repository at this point in the history
  • Loading branch information
djnunez-aot authored Aug 30, 2023
1 parent 72a83ce commit 324e819
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
35 changes: 35 additions & 0 deletions met-api/migrations/versions/1c5883959156_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""
Revision ID: 1c5883959156
Revises: f037908194df
Create Date: 2023-08-29 20:37:58.652800
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '1c5883959156'
down_revision = 'f037908194df'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('feedback', 'status',
existing_type=postgresql.ENUM(
'Unreviewed', 'Archived', name='feedbackstatustype'),
nullable=False)
op.execute('UPDATE "feedback" SET status = \'Unreviewed\'')
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('feedback', 'status',
existing_type=postgresql.ENUM(
'Unreviewed', 'Archived', name='feedbackstatustype'),
nullable=True)
# ### end Alembic commands ###
3 changes: 2 additions & 1 deletion met-api/src/met_api/models/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class Feedback(BaseModel):

__tablename__ = 'feedback'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
status = db.Column(db.Enum(FeedbackStatusType), nullable=True)
status = db.Column(db.Enum(FeedbackStatusType),
nullable=False, default=FeedbackStatusType.Unreviewed)
rating = db.Column(db.Enum(RatingType), nullable=True)
comment_type = db.Column(db.Enum(CommentType), nullable=True)
comment = db.Column(db.Text, nullable=True)
Expand Down

0 comments on commit 324e819

Please sign in to comment.