1
# Copyright 2015 Midokura SARL
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
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,
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.
17
Revision ID: d8a5c672761
19
Create Date: 2015-03-16 06:04:40.695379
23
# revision identifiers, used by Alembic.
24
revision = 'd8a5c672761'
25
down_revision = '25aeae45d4ad'
27
from alembic import op
29
import sqlalchemy as sa
34
op.create_table('midonet_data_versions',
35
sa.Column('id', sa.Integer(), primary_key=True),
36
sa.Column('sync_started_at', sa.DateTime()),
37
sa.Column('sync_finished_at', sa.DateTime()),
38
sa.Column('sync_status', sa.String(length=50)),
39
sa.Column('sync_tasks_status', sa.String(length=50)),
40
sa.Column('stale', sa.Boolean(), nullable=False))
42
op.create_table('midonet_data_state',
43
sa.Column('id', sa.Integer(), primary_key=True),
44
sa.Column('last_processed_task_id', sa.Integer()),
45
sa.Column('updated_at', sa.DateTime(),
46
default=datetime.datetime.utcnow,
48
sa.Column('active_version', sa.Integer()),
49
sa.Column('readonly', sa.Boolean(), nullable=False),
50
sa.ForeignKeyConstraint(
51
['last_processed_task_id'], ['midonet_tasks.id']),
52
sa.ForeignKeyConstraint(
54
['midonet_data_versions.id']))
56
op.execute("INSERT INTO midonet_data_state (id, last_processed_task_id, "
57
"updated_at, active_version, readonly) VALUES (1, NULL, '%s', "
58
"NULL, false)" % (datetime.datetime.utcnow()))
b'\\ No newline at end of file'