-- Add up migration script here
CREATE TABLE
  `gift_exchange` (
    `id` integer not null primary key autoincrement,
    `created_at` INTEGER not null default CURRENT_TIMESTAMP,
    `created_by` integer not null default 0,
    `updated_at` INTEGER not null default CURRENT_TIMESTAMP,
    `updated_by` integer not null default 0,
    `name` varchar(255) not null,
    `exchange_date` INTEGER not null,
    `status` INTEGER not null default 0,
    unique (`id`)
  );

  CREATE TABLE
  `gift_exchange_participants` (
    `id` integer not null primary key autoincrement,
    `created_at` INTEGER not null default CURRENT_TIMESTAMP,
    `created_by` integer not null default 0,
    `updated_at` INTEGER not null default CURRENT_TIMESTAMP,
    `updated_by` integer not null default 0,
    `exchange_id` INTEGER not null,
    `participant_id` INTEGER not null,
    `gifter_id` INTEGER not null,
    unique (`id`)
  );

insert into `role_permissions` (`created_at`, `created_by`, `id`, `item`, `role_id`, `updated_at`, `updated_by`) values ('0', '0', '10', '/giftexchange', '2', '0', '0')