71d82732c32c884fcd14ee3c7d5f52da71a0769a
[fds.git] /
1 # Copyright (c) 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 """Opendaylight Neutron mechanism driver refactor
17
18 Revision ID: 37e242787ae5
19 Revises: 247501328046
20 Create Date: 2015-10-30 22:09:27.221767
21
22 """
23 from neutron.db import migration
24
25
26 # revision identifiers, used by Alembic.
27 revision = '37e242787ae5'
28 down_revision = '247501328046'
29
30 # milestone identifier, used by neutron-db-manage
31 neutron_milestone = [migration.MITAKA]
32
33
34 from alembic import op
35 import sqlalchemy as sa
36
37
38 def upgrade():
39     op.create_table(
40         'opendaylightjournal',
41         sa.Column('id', sa.String(36), primary_key=True),
42         sa.Column('object_type', sa.String(36), nullable=False),
43         sa.Column('object_uuid', sa.String(36), nullable=False),
44         sa.Column('operation', sa.String(36), nullable=False),
45         sa.Column('data', sa.PickleType, nullable=True),
46         sa.Column('state',
47                   sa.Enum('pending', 'processing', 'failed', 'completed',
48                           name='state'),
49                   nullable=False, default='pending'),
50         sa.Column('retry_count', sa.Integer, default=0),
51         sa.Column('created_at', sa.DateTime, default=sa.func.now()),
52         sa.Column('last_retried', sa.TIMESTAMP, server_default=sa.func.now(),
53                   onupdate=sa.func.now())
54     )