Skip to content

Fix compilation errors after merging schema changes

Norman Rzepka edited this page Jan 11, 2023 · 4 revisions

After merging changes to the sql schema into your branch, some manual steps are required. We are working on automating some of them, but for now:

(1) Get Your Database’s Schema Up To Date

(1a) Quick and with data loss

  • run yarn refresh-schema to drop your db’s contents and load a fresh schema from schema.sql

(1b) OR: Keep your data with evolutions

  • conf/evolutions/ contains sql code to migrate your data to newer schema versions.
  • to help you figure out which ones you need, you can optionally run tools/postgres/diff_schema.js tools/postgres/schema.sql DB
  • apply the evolutions in the correct order, e.g. by copying their content to a pgadmin query tool that is connected to your db and executing them there.

(2) Update the Slick access code

  • run rm target/scala-2.12/src_managed/schema/com/scalableminds/webknossos/schema/Tables.scala so that the scala compiler subsequently recreates it from the now up-to-date schema in your db

Still trouble?

If the above steps didn't help. Try to run docker-compose down and repeat the above steps.