Skip to content

Commit dc57e2a

Browse files
author
Connor Bechthold
committed
remove attn_to column
1 parent 4315888 commit dc57e2a

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

backend/app/models/log_records.py

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ class LogRecords(db.Model):
99
employee_id = db.Column(db.Integer, db.ForeignKey("users.id"), nullable=False)
1010
datetime = db.Column(db.DateTime(timezone=True), nullable=False)
1111
flagged = db.Column(db.Boolean, nullable=False)
12-
attn_to = db.Column(db.Integer, db.ForeignKey("users.id"), nullable=True)
1312
note = db.Column(db.String, nullable=False)
1413
building_id = db.Column(db.Integer, db.ForeignKey("buildings.id"), nullable=False)
1514
tags = db.relationship(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""remove attn_to column from log records table
2+
3+
Revision ID: 5a9f9b3bdc20
4+
Revises: 51ad56d133e9
5+
Create Date: 2024-04-21 04:15:23.112342
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
11+
12+
# revision identifiers, used by Alembic.
13+
revision = '5a9f9b3bdc20'
14+
down_revision = '51ad56d133e9'
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
# ### commands auto generated by Alembic - please adjust! ###
21+
with op.batch_alter_table('log_records', schema=None) as batch_op:
22+
batch_op.drop_constraint('log_records_attn_to_fkey', type_='foreignkey')
23+
batch_op.drop_column('attn_to')
24+
25+
# ### end Alembic commands ###
26+
27+
28+
def downgrade():
29+
# ### commands auto generated by Alembic - please adjust! ###
30+
with op.batch_alter_table('log_records', schema=None) as batch_op:
31+
batch_op.add_column(sa.Column('attn_to', sa.INTEGER(), autoincrement=False, nullable=True))
32+
batch_op.create_foreign_key('log_records_attn_to_fkey', 'users', ['attn_to'], ['id'])
33+
34+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)