Coverage for /builds/BuildGrid/buildgrid/buildgrid/server/persistence/sql/alembic/versions/29e88b3e0d0a_store_tool_information_for_a_job_in_the_.py: 76.47%

17 statements  

« prev     ^ index     » next       coverage.py v7.4.1, created at 2024-06-11 15:37 +0000

1# Copyright (C) 2020 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. 

14 

15"""Store tool information for a job in the database 

16 

17 

18Revision ID: 29e88b3e0d0a 

19Revises: 8d910c8de8b6 

20Create Date: 2020-10-16 14:35:49.304924 

21 

22""" 

23import sqlalchemy as sa 

24from alembic import op 

25 

26# revision identifiers, used by Alembic. 

27revision = "29e88b3e0d0a" 

28down_revision = "8d910c8de8b6" 

29branch_labels = None 

30depends_on = None 

31 

32 

33def upgrade() -> None: 

34 op.add_column("operations", sa.Column("correlated_invocations_id", sa.String(), nullable=True)) 

35 op.add_column("operations", sa.Column("invocation_id", sa.String(), nullable=True)) 

36 op.add_column("operations", sa.Column("tool_name", sa.String(), nullable=True)) 

37 op.add_column("operations", sa.Column("tool_version", sa.String(), nullable=True)) 

38 

39 

40def downgrade() -> None: 

41 op.drop_column("operations", "tool_version") 

42 op.drop_column("operations", "tool_name") 

43 op.drop_column("operations", "invocation_id") 

44 op.drop_column("operations", "correlated_invocations_id")