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

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

17 statements  

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""" 

23from alembic import op 

24import sqlalchemy as sa 

25 

26 

27# revision identifiers, used by Alembic. 

28revision = '29e88b3e0d0a' 

29down_revision = '8d910c8de8b6' 

30branch_labels = None 

31depends_on = None 

32 

33 

34def upgrade(): 

35 op.add_column('operations', sa.Column('correlated_invocations_id', sa.String(), nullable=True)) 

36 op.add_column('operations', sa.Column('invocation_id', sa.String(), nullable=True)) 

37 op.add_column('operations', sa.Column('tool_name', sa.String(), nullable=True)) 

38 op.add_column('operations', sa.Column('tool_version', sa.String(), nullable=True)) 

39 

40 

41def downgrade(): 

42 op.drop_column('operations', 'tool_version') 

43 op.drop_column('operations', 'tool_name') 

44 op.drop_column('operations', 'invocation_id') 

45 op.drop_column('operations', 'correlated_invocations_id')