Skip to content

Commit

Permalink
Create migration for new gene function tables
Browse files Browse the repository at this point in the history
  • Loading branch information
naglepuff committed Oct 9, 2024
1 parent 36d4bf6 commit f970a95
Showing 1 changed file with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"""Add tables to store COG and PFAM terms
Separate these from the existing KEGG terms to allow
for more specific searches.
Revision ID: d89192564855
Revises: 5fb9910ca8e6
Create Date: 2024-10-09 20:08:45.656007
"""

from typing import Optional

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision: str = "d89192564855"
down_revision: Optional[str] = "5fb9910ca8e6"
branch_labels: Optional[str] = None
depends_on: Optional[str] = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"cog_term_text",
sa.Column("term", sa.String(), nullable=False),
sa.Column("text", sa.Text(), nullable=False),
sa.PrimaryKeyConstraint("term", name=op.f("pk_cog_term_text")),
)
op.create_table(
"pfam_term_text",
sa.Column("term", sa.String(), nullable=False),
sa.Column("text", sa.Text(), nullable=False),
sa.PrimaryKeyConstraint("term", name=op.f("pk_pfam_term_text")),
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table("pfam_term_text")
op.drop_table("cog_term_text")
# ### end Alembic commands ###

0 comments on commit f970a95

Please sign in to comment.