CCDB Schema Changes in Version 1.00

From GlueXWiki
Jump to: navigation, search

From Dmitry Romanov.

This change was announced in January 2014.

There were changes in the CCDB database schema in going from from 0.9 to 1.00. These correspond to the internal database version numbers changing from 3 to 4. The change was to add the "isDeleted" flag to user records to support the case where a user is deleted for authentication purposes, but needs to be retained in the database for history purposes.

  • CCDB 0.9 works with databases with the 1.0 schema.
  • CCDB 1.0 doesn't work with databases with the 0.9 schema.

Because of this CCDB now checks the version of the schema. The central MySQL database uses version 4 and is thus compatible with CCDB 1.0.

Old versions of databases can be upgraded. There are two SQL patches to update SQLite and MySQL:

  • $CCDB_HOME/sql/update_0.09_1.00.mysql.sql
  • $CCDB_HOME/sql/update_0.09_1.00.sqlite.sql

To upgrade an old SQLlite database,

 sqlite3 <your_db>.sqlite < $CCDB_HOME/sql/update_0.09_1.00.sqlite.sql