Debian Codegraph @

neutron_vpnaas/db/migration/alembic_migrations/versions/3ea02b2a773e_add_index_tenant_id.py

raw
1 # Copyright 2015 OpenStack Foundation
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
4 # not use this file except in compliance with the License. You may obtain
5 # 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, WITHOUT
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 # License for the specific language governing permissions and limitations
13 # under the License.
14 #
15
16 """add_index_tenant_id
17
18 Revision ID: 3ea02b2a773e
19 Revises: start_neutron_vpnaas
20 Create Date: 2015-02-10 17:51:10.752504
21
22 """
23
24 from alembic import op
25
26 # revision identifiers, used by Alembic.
27 revision = '3ea02b2a773e'
28 down_revision = 'start_neutron_vpnaas'
29
30 TABLES = ['ipsecpolicies', 'ikepolicies', 'ipsec_site_connections',
31 'vpnservices']
32
33
34 def upgrade():
35 for table in TABLES:
36 op.create_index(op.f('ix_%s_tenant_id' % table),
37 table, ['tenant_id'], unique=False)