Skip to content

Commit

Permalink
fix data migration upgrade chain w.r.t. key naming conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
nhoening committed Apr 2, 2021
1 parent 6bda039 commit 190d71f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion documentation/dev/ci.rst
Expand Up @@ -94,7 +94,7 @@ The deployment uses git's ability to push code to a remote upstream repository.

We trigger this deployment in ``deploy.yml`` and it's being done in ``DEPLOY.sh``. There, we add the remote and then push the current branch to it.

We thus need to tell the deployment evnironment two things:
We thus need to tell the deployment environment two things:


* Add the setting ``STAGING_REMOTE_REPO`` as an environment variable on the deployment environment (e.g. ``deploy.yml`` expects it in the Github repository secrets). An example value is ``seita@ssh.our-server.com:/home/seita/flexmeasures-staging/flexmeasures.git``.
Expand Down
Expand Up @@ -19,7 +19,7 @@
def upgrade():
op.add_column("asset", sa.Column("market_id", sa.Integer(), nullable=True))
op.create_foreign_key(
"asset_market_id_fkey", "asset", "market", ["market_id"], ["id"]
"asset_market_id_market_fkey", "asset", "market", ["market_id"], ["id"]
)
op.execute(
"""
Expand All @@ -29,5 +29,5 @@ def upgrade():


def downgrade():
op.drop_constraint("asset_market_id_fkey", "asset", type_="foreignkey")
op.drop_constraint("asset_market_id_market_fkey", "asset", type_="foreignkey")
op.drop_column("asset", "market_id")
Expand Up @@ -20,7 +20,7 @@ def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("data_sources", sa.Column("user_id", sa.Integer(), nullable=True))
op.drop_constraint(
"data_sources_source_id_fkey", "data_sources", type_="foreignkey"
"data_sources_source_id_bvp_users_fkey", "data_sources", type_="foreignkey"
)
op.create_foreign_key(None, "data_sources", "bvp_users", ["user_id"], ["id"])
op.drop_column("data_sources", "source_id")
Expand All @@ -35,7 +35,7 @@ def downgrade():
)
op.drop_constraint(None, "data_sources", type_="foreignkey")
op.create_foreign_key(
"data_sources_source_id_fkey",
"data_sources_source_id_bvp_users_fkey",
"data_sources",
"bvp_users",
["source_id"],
Expand Down

0 comments on commit 190d71f

Please sign in to comment.