text: """add category model
  
  Revision ID: 075d34b40a19
  Revises: 6d1746022419
  Create Date: 2021-03-23 16:45:46.489059
  
  """
  from alembic import op
  import sqlalchemy as sa
  
  
  # revision identifiers, used by Alembic.
  revision = '075d34b40a19'
  down_revision = '6d1746022419'
  branch_labels = None
  depends_on = None
  
  
  def upgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.create_table('category',
      sa.Column('id', sa.Integer(), nullable=False),
      sa.Column('name', sa.String(length=140), nullable=False),
      sa.Column('slug', sa.String(length=140), nullable=False),
      sa.Column('description', sa.Text(), nullable=True),
      sa.Column('parent_id', sa.Integer(), nullable=True),
      sa.ForeignKeyConstraint(['parent_id'], ['category.id'], ),
      sa.PrimaryKeyConstraint('id'),
      sa.UniqueConstraint('slug')
      )
      op.create_index(op.f('ix_category_name'), 'category', ['name'], unique=True)
      op.create_table('product_categories',
      sa.Column('product_id', sa.Integer(), nullable=False),
      sa.Column('category_id', sa.Integer(), nullable=False),
      sa.ForeignKeyConstraint(['category_id'], ['category.id'], ),
      sa.ForeignKeyConstraint(['product_id'], ['product.id'], ),
      sa.PrimaryKeyConstraint('product_id', 'category_id')
      )
      # ### end Alembic commands ###
  
  
  def downgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.drop_table('product_categories')
      op.drop_index(op.f('ix_category_name'), table_name='category')
      op.drop_table('category')
      # ### end Alembic commands ###
  