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

Added script to apply all new evolutions #3427

Merged
merged 9 commits into from
Nov 22, 2018
Merged

Conversation

rschwanhold
Copy link
Contributor

@rschwanhold rschwanhold commented Nov 1, 2018

Steps to test:

  • apply the last reversion
  • run yarn apply-evolutions

Issues:


@rschwanhold rschwanhold self-assigned this Nov 1, 2018

# get list of schemas to apply
files=""
for entry in "../../conf/evolutions"/*
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can I get the absolute path to this folder?
When I run ./apply_evolutions.sh from the right directory everything works, but when I run yarn apply-evolutions it seems like it does not find the evolutions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could make the path be relative to the script’s directory
https://stackoverflow.com/a/246128/7564727

Copy link
Contributor

@jstriebel jstriebel Nov 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually use scriptdir="$(dirname "$0")" to get the path of the script, and then use everything relatively to that. An example is https://github.com/scalableminds/webknossos/blob/master/tools/postgres/ensure_db.sh

Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

tools/postgres/apply_evolutions.sh Outdated Show resolved Hide resolved
tools/postgres/apply_evolutions.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@jstriebel jstriebel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice script! 👍 Please add the small changes @fm3 and I suggested, then this is ready for merge :-)

tools/postgres/apply_evolutions.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@jstriebel jstriebel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 🚢

@rschwanhold rschwanhold merged commit 07b13ed into master Nov 22, 2018
jfrohnhofen added a commit that referenced this pull request Nov 23, 2018
* origin/master:
  Optimize performance for the list request /api/datasets (#3441)
  add annotation dataset foreign key  (#3482)
  thumbnails: correctly use zoom value if specified (#3487)
  Store Meshes in Postgres (#3367)
  fix alpha return (#3483)
  Added script to apply all new evolutions (#3427)
  Simple fix to speed up dataset gallery (#3480)
  better errors for screenshot tests, fix imports, refresh screenshots (#3479)
  (Backend only) Add project priority to progress report json (#3476)
  Handle missing write access on datastore (#3411)
  Re-introduce "Flightmode improvements"" (#3473)
  Circleci-notify: linkify PR number (#3469)
  Revert "Flightmode improvements" (#3472)
  also flow-ignore binaryData when using symlinks (#3471)
  Flightmode improvements (#3392)
  Circleci custom notification (#3465)
  enable /api/switch cross-organization (#3464)
@normanrz normanrz deleted the evolutions-script branch February 20, 2019 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

script to apply missing migrations
3 participants