Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alembic Script update #2000

Merged
merged 3 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions augur/application/db/models/augur_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,10 +783,8 @@ class Repo(Base):
ForeignKey("augur_data.repo_groups.repo_group_id"), nullable=False
)
repo_git = Column(String, nullable=False)
repo_path = Column(String, server_default=text("'NULL'::character varying"))
repo_name = Column(
String, server_default=text("'NULL'::character varying")
)
repo_path = Column(String)
repo_name = Column(String)
repo_added = Column(
TIMESTAMP(precision=0), nullable=False, server_default=text("CURRENT_TIMESTAMP")
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"""updated revision data size to 128

Revision ID: 12
Revises: 11
Create Date: 2022-10-06 01:28:48.146894

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '12'
down_revision = '11'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_foreign_key(None, 'commits', 'contributors', ['cmt_ght_author_id'], ['cntrb_id'], source_schema='augur_data', referent_schema='augur_data')
op.alter_column('releases', 'release_id',
existing_type=sa.CHAR(length=64),
type_=sa.CHAR(length=128),
existing_nullable=False,
existing_server_default=sa.text('nextval(\'"augur_data".releases_release_id_seq\'::regclass)'),
schema='augur_data')
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('releases', 'release_id',
existing_type=sa.CHAR(length=128),
type_=sa.CHAR(length=64),
existing_nullable=False,
existing_server_default=sa.text('nextval(\'"augur_data".releases_release_id_seq\'::regclass)'),
schema='augur_data')
op.drop_constraint(None, 'commits', schema='augur_data', type_='foreignkey')
# ### end Alembic commands ###