ciclos

ref: configuration

src/alembic/versions/b80a277fdc89_create_configuration.py


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""create configuration

Revision ID: b80a277fdc89
Revises: 1a8c88c6e1e4
Create Date: 2020-01-14 00:52:43.495301

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'b80a277fdc89'
down_revision = '1a8c88c6e1e4'
branch_labels = None
depends_on = None


def upgrade():
    op.create_table('configurations', 
        sa.Column('id', sa.Integer, primary_key = True),
        sa.Column('purchase_duration', sa.Float, nullable = False),
        sa.Column('purchase_duration_type', sa.String(256), server_default = 'days'),
        sa.Column('delivery_duration', sa.Float, nullable = False),
        sa.Column('delivery_duration_type', sa.String(256), server_default = 'days'),
        sa.Column('created_at', sa.DateTime),
        sa.Column('updated_at', sa.DateTime)
    )

def downgrade():
    op.drop_table('configurations')