Coverage for /builds/BuildGrid/buildgrid/buildgrid/server/sql/alembic/versions/23f48374c8b6_add_property_label.py: 80.00%
15 statements
« prev ^ index » next coverage.py v7.4.1, created at 2024-10-04 17:48 +0000
« prev ^ index » next coverage.py v7.4.1, created at 2024-10-04 17:48 +0000
1# Copyright (C) 2024 Bloomberg LP
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# <http://www.apache.org/licenses/LICENSE-2.0>
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
15"""Add property label
17Revision ID: 23f48374c8b6
18Revises: fe3a61461feb
19Create Date: 2024-09-05 11:49:28.973640
21"""
22import sqlalchemy as sa
23from alembic import op
25# revision identifiers, used by Alembic.
26revision = "23f48374c8b6"
27down_revision = "fe3a61461feb"
28branch_labels = None
29depends_on = None
32def upgrade() -> None:
33 # ### commands auto generated by Alembic - please adjust! ###
34 op.add_column("jobs", sa.Column("property_label", sa.String(), server_default="unknown", nullable=False))
35 op.drop_index("ix_jobs_stage", table_name="jobs")
36 op.create_index("ix_jobs_stage_property_label", "jobs", ["stage", "property_label"], unique=False)
37 # ### end Alembic commands ###
40def downgrade() -> None:
41 # ### commands auto generated by Alembic - please adjust! ###
42 op.drop_index("ix_jobs_stage_property_label", table_name="jobs")
43 op.create_index("ix_jobs_stage", "jobs", ["stage"], unique=False)
44 op.drop_column("jobs", "property_label")
45 # ### end Alembic commands ###