1 # Copyright 2014 OpenStack Foundation
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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
16 """add_uniqueconstraint_ipavailability_ranges
18 Revision ID: 44621190bc02
20 Create Date: 2014-09-23 15:14:15.051921
24 # revision identifiers, used by Alembic.
25 revision = '44621190bc02'
26 down_revision = 'juno'
28 from alembic import op
31 TABLE_NAME = 'ipavailabilityranges'
32 UC_1_NAME = 'uniq_ipavailabilityranges0first_ip0allocation_pool_id'
33 UC_2_NAME = 'uniq_ipavailabilityranges0last_ip0allocation_pool_id'
37 op.create_unique_constraint(
40 local_cols=['first_ip', 'allocation_pool_id']
43 op.create_unique_constraint(
46 local_cols=['last_ip', 'allocation_pool_id']