Implement alemic database migrations

This commit is contained in:
Jeremy Zhang
2017-05-30 20:34:29 -07:00
parent 8cdb5c8ccf
commit b3051ab6bd
14 changed files with 468 additions and 0 deletions

View File

@ -0,0 +1,30 @@
"""Create keyvalue table
Revision ID: 347cb289508e
Revises: a785afdbfa91
Create Date: 2017-05-30 20:16:22.543157
"""
# revision identifiers, used by Alembic.
revision = '347cb289508e'
down_revision = 'a785afdbfa91'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'keyvalue_properties',
sa.Column('id', sa.Integer, primary_key=True),
sa.Column('key', sa.String(255), nullable=False),
sa.Column('value', sa.Text()),
sa.Column('expiration', sa.TIMESTAMP),
)
def downgrade():
op.drop_table('keyvalue_properties')