"public/git@gitlab.groupbwt.com:ivelov-vm/landing-pad.git" did not exist on "190119e693475d9d7f7d60216981de2129f6336c"
Newer
Older
Create Date: 2019-06-17 13:21:39.815414
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('books',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('url', sa.String(length=255), nullable=True),
sa.Column('title', sa.String(length=255), nullable=False),
sa.Column('description', sa.Text(), nullable=True),
sa.Column('image_path', sa.String(length=255), nullable=True),
sa.Column('rating', sa.SmallInteger(), nullable=True),
sa.Column('upc', sa.String(length=32), nullable=True),
sa.Column('product_type', sa.String(length=32), nullable=True),
sa.Column('price_excl_tax', sa.Numeric(precision=6, scale=2), nullable=True),
sa.Column('price_incl_tax', sa.Numeric(precision=6, scale=2), nullable=True),
sa.Column('tax', sa.Numeric(precision=6, scale=2), nullable=True),
sa.Column('in_stock', sa.Integer(), nullable=True),
sa.Column('count_reviews', sa.Integer(), nullable=True),
sa.Column('category', sa.String(length=32), nullable=True),
sa.Column('currency_type', sa.String(length=4), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('updated_at', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('upc')
)
op.create_index(op.f('ix_books_category'), 'books', ['category'], unique=False)
op.create_index(op.f('ix_books_count_reviews'), 'books', ['count_reviews'], unique=False)
op.create_index(op.f('ix_books_currency_type'), 'books', ['currency_type'], unique=False)
op.create_index(op.f('ix_books_in_stock'), 'books', ['in_stock'], unique=False)
op.create_index(op.f('ix_books_price_excl_tax'), 'books', ['price_excl_tax'], unique=False)
op.create_index(op.f('ix_books_price_incl_tax'), 'books', ['price_incl_tax'], unique=False)
op.create_index(op.f('ix_books_product_type'), 'books', ['product_type'], unique=False)
op.create_index(op.f('ix_books_rating'), 'books', ['rating'], unique=False)
op.create_index(op.f('ix_books_tax'), 'books', ['tax'], unique=False)
op.create_index(op.f('ix_books_title'), 'books', ['title'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_books_title'), table_name='books')
op.drop_index(op.f('ix_books_tax'), table_name='books')
op.drop_index(op.f('ix_books_rating'), table_name='books')
op.drop_index(op.f('ix_books_product_type'), table_name='books')
op.drop_index(op.f('ix_books_price_incl_tax'), table_name='books')
op.drop_index(op.f('ix_books_price_excl_tax'), table_name='books')
op.drop_index(op.f('ix_books_in_stock'), table_name='books')
op.drop_index(op.f('ix_books_currency_type'), table_name='books')
op.drop_index(op.f('ix_books_count_reviews'), table_name='books')
op.drop_index(op.f('ix_books_category'), table_name='books')
op.drop_table('books')
# ### end Alembic commands ###