Merge "Fix Watcher DB schema creation"

This commit is contained in:
Jenkins
2017-09-27 08:36:31 +00:00
committed by Gerrit Code Review
2 changed files with 19 additions and 15 deletions

View File

@@ -68,4 +68,4 @@
.. code-block:: ini .. code-block:: ini
su -s /bin/sh -c "watcher-db-manage --config-file /etc/watcher/watcher.conf create_schema" su -s /bin/sh -c "watcher-db-manage --config-file /etc/watcher/watcher.conf upgrade"

View File

@@ -6,25 +6,29 @@ Create Date: 2017-07-13 20:33:01.473711
""" """
# revision identifiers, used by Alembic.
revision = 'd09a5945e4a0'
down_revision = 'd098df6021e2'
from alembic import op from alembic import op
import oslo_db import oslo_db
import sqlalchemy as sa import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd09a5945e4a0'
down_revision = 'd098df6021e2'
def upgrade(): def upgrade():
op.create_table('action_descriptions', op.create_table(
'action_descriptions',
sa.Column('created_at', sa.DateTime(), nullable=True), sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('updated_at', sa.DateTime(), nullable=True), sa.Column('updated_at', sa.DateTime(), nullable=True),
sa.Column('deleted_at', sa.DateTime(), nullable=True), sa.Column('deleted_at', sa.DateTime(), nullable=True),
sa.Column('deleted', oslo_db.sqlalchemy.types.SoftDeleteInteger(), nullable=True), sa.Column('deleted', oslo_db.sqlalchemy.types.SoftDeleteInteger(),
nullable=True),
sa.Column('id', sa.Integer(), nullable=False), sa.Column('id', sa.Integer(), nullable=False),
sa.Column('action_type', sa.String(length=255), nullable=False), sa.Column('action_type', sa.String(length=255), nullable=False),
sa.Column('description', sa.String(length=255), nullable=False), sa.Column('description', sa.String(length=255), nullable=False),
sa.PrimaryKeyConstraint('id'), sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('action_type', name='uniq_action_description0action_type') sa.UniqueConstraint('action_type',
name='uniq_action_description0action_type')
) )