Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • For Database migrations/management, we use FlywayDB
    • The migration scripts are available in the dspace-api source code under the org.dspace.storage.rdbms.sqlmigration package: https://github.com/DSpace/DSpace/tree/master/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration
    • Each new migration script should be named "V[version]_[date]__[description].sql", where [version] is the DSpace version supporting this change, [date] is the date of the change, and [description] includes the associated ticket number and brief description of the migration. For example: "V5.0_2014.09.26__DS-1582_Metadata_For_All_Objects.sql".
    • NOTE: Whenever possible, please avoid modifying migration scripts from a prior DSpace release.  Flyway does not compare modified scripts against the current database structure, so it will not modify tables based on modifications to existing migration scripts. Therefore, modifications to existing scripts may result in some (or all) DSpace users having to manually run those database changes during their next upgrade.
      • Instead, where possible, consider creating a migration script (in SQL or Java) that will run just before (or after) the script you are looking to modify. For example, if you need a migration to run before "V5.0_2014.09.26_myscript.sql", create one named "V4.9_2016.01.01_myscript_update.sql".
  • If your database migration adds new sequences, then you should also be sure to update the update-sequences script at:
    • [dspace-src]/dspace/etc/[db-type]/update-sequences.sql
    • At this time, this updated-sequences script is maintained outside of the database migrations as it is useful to run manually after large restorations, etc.

...