Versions Compared

Key

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

Database:Holiday Tables

These tables organize the different holidays and their respective types.  Holiday table for the holidays, type table for the different holiday types, and holiday_type to link the different holidays to their types.

Create database holidays;

...

create table holiday_type (
  holiday_id int not null,
  type_id int not null,
  primary key(holiday_id, type_id),
  index type_idx(type_id),
  FOREIGN KEY (holiday_id) REFERENCES holiday(id) ON DELETE CASCADE,
  FOREIGN KEY (type_id) REFERENCES type(id) ON DELETE CASCADE
) Engine=InnoDB;

User Tables

These tables are similar to the holiday tables in that there is one table for users, one table for user roles (admin and user), and one table connecting users to their role.  However these tables are automatically generated by Grails.  This is because Grails convention is that there is a table for each domain class.