-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create migration for new gene function tables
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
nmdc_server/migrations/versions/d89192564855_add_cog_pfam_term_tables.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ### |