Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changes to DB schema instructions

...

Database schema changes will be done only on major revisions to the source; this is when the version number takes the form x.0 (e.g. 2.0). When making patches which cause schema changes, it is necessary to update all of the relevant SQL/migration files with your sequences, tables, views etc. (in /dspace/etc/postgresql, /dspace/etc/oracle, and /dspace/etc/h2): 

  • 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".
  • 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.
  • database_schema.sql - the SQL to create the database from scratch
  • clean-database.sql - the SQL to remove all the parts of the database
  • database_schema_<old version>-<new version>.sql (e.g. database_schema_11_12.sql) - the SQL to update the <old version> of the schema to the <new version>
  • update-sequences.sql - the SQL to ensure that sequences are set correctly

Documentation Contributions

All new features require documentation before they will be accepted. You may send us code before documentation is completed, but we will be unable to accept that code into DSpace until it is properly documented. Bug fixes may not require documentation, unless they somehow make a modification which changes how DSpace functions.

As of 1.7.0, the All documentation is now built in a special section of the Wiki at DSpace Documentation. Therefore, the best way to send us Documentation is to actually create a new page(s) in this DSpace Wiki. You should link these Wiki page(s) to your issue in our DSpace Issue Tracker. We'll move them over into the official DSpace Documentation area once you code has been accepted.