GridSafeDocumentation/DatabaseTables/

Database Tables

Grid-SAFE stores data in mysql database tables. In general these tables are intended to be human readable. Where possible, Grid-SAFE is flexible as to the database schema used and to some extent will adapt to changes to the schema. However there are some general rules that need to be followed.

  • All tables must have a single auto_increment field that acts as the primary key for that table.
  • Cross references between tables should use the primary key and need to be identified as cross-references. When using INNODB tables it is sufficient to add appropriate FOREIGN KEY constraints to the table definition. MyISAM tables do not support foreign keys. In this case you need to define a configuration property of the form reference.[table-name].[field-name]=[remote-table].

This mechanism will also work with INNODB tables if you wish to avoid the overhead of foreign key checking.

Date/time values can either be stored in SQL TIMESTAMP fields or as INTEGER fields recording seconds from the UNIX time epoch.

Each table in the database has a corresponding Java handler class. The handler class to use for a particular table is defined by setting the class.[table-name] configuration property.

The above rules will automatically be followed if you use the built in administration forms.

 

Grid-SAFE was funded by JISC and is maintained, developed, and managed by EPCC at the University of Edinburgh