Skip to content

Commit

Permalink
remove attn_to column
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-bechthold committed Apr 21, 2024
1 parent 4315888 commit dc57e2a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
1 change: 0 additions & 1 deletion backend/app/models/log_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class LogRecords(db.Model):
employee_id = db.Column(db.Integer, db.ForeignKey("users.id"), nullable=False)
datetime = db.Column(db.DateTime(timezone=True), nullable=False)
flagged = db.Column(db.Boolean, nullable=False)
attn_to = db.Column(db.Integer, db.ForeignKey("users.id"), nullable=True)
note = db.Column(db.String, nullable=False)
building_id = db.Column(db.Integer, db.ForeignKey("buildings.id"), nullable=False)
tags = db.relationship(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""remove attn_to column from log records table
Revision ID: 5a9f9b3bdc20
Revises: 51ad56d133e9
Create Date: 2024-04-21 04:15:23.112342
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5a9f9b3bdc20'
down_revision = '51ad56d133e9'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('log_records', schema=None) as batch_op:
batch_op.drop_constraint('log_records_attn_to_fkey', type_='foreignkey')
batch_op.drop_column('attn_to')

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('log_records', schema=None) as batch_op:
batch_op.add_column(sa.Column('attn_to', sa.INTEGER(), autoincrement=False, nullable=True))
batch_op.create_foreign_key('log_records_attn_to_fkey', 'users', ['attn_to'], ['id'])

# ### end Alembic commands ###

0 comments on commit dc57e2a

Please sign in to comment.