text: """Adding feature labels
  
  Revision ID: f7b5a1a03629
  Revises: 2b6d23c715aa
  Create Date: 2020-11-09 11:19:51.472174
  
  """
  import sqlalchemy as sa
  from alembic import op
  
  from mlrun.api.utils.db.sql_collation import SQLCollationUtil
  
  # revision identifiers, used by Alembic.
  revision = "f7b5a1a03629"
  down_revision = "2b6d23c715aa"
  branch_labels = None
  depends_on = None
  
  
  def upgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.create_table(
          "entities_labels",
          sa.Column("id", sa.Integer(), nullable=False),
          sa.Column(
              "name",
              sa.String(255, collation=SQLCollationUtil.collation()),
              nullable=True,
          ),
          sa.Column(
              "value",
              sa.String(255, collation=SQLCollationUtil.collation()),
              nullable=True,
          ),
          sa.Column("parent", sa.Integer(), nullable=True),
          sa.ForeignKeyConstraint(
              ["parent"],
              ["entities.id"],
          ),
          sa.PrimaryKeyConstraint("id"),
          sa.UniqueConstraint("name", "parent", name="_entities_labels_uc"),
      )
      op.create_table(
          "features_labels",
          sa.Column("id", sa.Integer(), nullable=False),
          sa.Column(
              "name",
              sa.String(255, collation=SQLCollationUtil.collation()),
              nullable=True,
          ),
          sa.Column(
              "value",
              sa.String(255, collation=SQLCollationUtil.collation()),
              nullable=True,
          ),
          sa.Column("parent", sa.Integer(), nullable=True),
          sa.ForeignKeyConstraint(
              ["parent"],
              ["features.id"],
          ),
          sa.PrimaryKeyConstraint("id"),
          sa.UniqueConstraint("name", "parent", name="_features_labels_uc"),
      )
      # ### end Alembic commands ###
  
  
  def downgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.drop_table("features_labels")
      op.drop_table("entities_labels")
      # ### end Alembic commands ###
  