Coverage for /builds/BuildGrid/buildgrid/buildgrid/server/persistence/sql/alembic/versions/083f52d97bcb_add_index_on_queued_timestamp.py: 90.91%

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

11 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"""Add index on queued_timestamp in jobs table 

16 

17Revision ID: 083f52d97bcb 

18Revises: 69ceb5938c06 

19Create Date: 2020-06-01 22:05:44.274091 

20 

21""" 

22from alembic import op 

23import sqlalchemy as sa 

24 

25 

26# revision identifiers, used by Alembic. 

27revision = '083f52d97bcb' 

28down_revision = '69ceb5938c06' 

29branch_labels = None 

30depends_on = None 

31 

32 

33def upgrade(): 

34 op.create_index(op.f('ix_jobs_queued_timestamp'), 'jobs', ['queued_timestamp'], unique=False) 

35 

36 

37def downgrade(): 

38 op.drop_index(op.f('ix_jobs_queued_timestamp'), table_name='jobs')