@cryptotaxi247 / CoPilot / commits / 3304e444

DB Migration for adding label to Agent Metadata (#76)

Co-authored-by: Graham Williamson <graham.williamson@socfortress.co>

taylor_socfortress committed Jul 26, 2023 at 17:42 UTC 3304e44442d253d5cf155fca825d333e18ee2fcf
1 file changed +31
backend/migrations/versions/7b25ec454c0a_add_label_to_agent_metadata.py new
+31
@@ -0,0 +1,31 @@
1 +"""Add label to Agent Metadata
2 +
3 +Revision ID: 7b25ec454c0a
4 +Revises: 09189f03c3ee
5 +Create Date: 2023-07-27 09:37:01.189629
6 +
7 +"""
8 +import sqlalchemy as sa
9 +from alembic import op
10 +
11 +# revision identifiers, used by Alembic.
12 +revision = "7b25ec454c0a"
13 +down_revision = "09189f03c3ee"
14 +branch_labels = None
15 +depends_on = None
16 +
17 +
18 +def upgrade():
19 + # ### commands auto generated by Alembic - please adjust! ###
20 + with op.batch_alter_table("agent_metadata", schema=None) as batch_op:
21 + batch_op.add_column(sa.Column("label", sa.String(length=100), nullable=True))
22 +
23 + # ### end Alembic commands ###
24 +
25 +
26 +def downgrade():
27 + # ### commands auto generated by Alembic - please adjust! ###
28 + with op.batch_alter_table("agent_metadata", schema=None) as batch_op:
29 + batch_op.drop_column("label")
30 +
31 + # ### end Alembic commands ###