· 6 years ago · Mar 10, 2019, 01:14 PM
1# --- Created by Ebean DDL
2# To stop Ebean DDL generation, remove this comment and start using Evolutions
3
4# --- !Ups
5
6create table exact_date (
7 id bigint auto_increment not null,
8 date date,
9 daypart integer,
10 holiday_message_id bigint not null,
11 constraint ck_exact_date_daypart check ( daypart in (0,1)),
12 constraint pk_exact_date primary key (id)
13);
14
15create table favorites (
16 employee_id varchar(255) not null,
17 constraint pk_favorites primary key (employee_id)
18);
19
20create table favorites_favorites (
21 favorites_employee_id varchar(255) not null,
22 favorite varchar(255) not null
23);
24
25create table holiday_message (
26 id bigint auto_increment not null,
27 employee_id varchar(255),
28 type integer,
29 state integer,
30 request_date timestamp,
31 request_by_id varchar(255),
32 comment varchar(255),
33 constraint ck_holiday_message_type check ( type in (0,1,2,3,4,5,6)),
34 constraint ck_holiday_message_state check ( state in (0,1,2,3)),
35 constraint pk_holiday_message primary key (id)
36);
37
38create index ix_exact_date_holiday_message_id on exact_date (holiday_message_id);
39alter table exact_date add constraint fk_exact_date_holiday_message_id foreign key (holiday_message_id) references holiday_message (id) on delete restrict on update restrict;
40
41create index ix_favorites_favorites_favorites_employee_id on favorites_favorites (favorites_employee_id);
42alter table favorites_favorites add constraint fk_favorites_favorites_favorites_employee_id foreign key (favorites_employee_id) references favorites (employee_id) on delete restrict on update restrict;
43
44create index ix_favorites_favorites_favorites on favorites_favorites (favorites_employee_id);
45alter table favorites_favorites add constraint fk_favorites_favorites_favorites foreign key (favorites_employee_id) references favorites (employee_id) on delete restrict on update restrict;
46
47
48# --- !Downs
49
50alter table exact_date drop constraint if exists fk_exact_date_holiday_message_id;
51drop index if exists ix_exact_date_holiday_message_id;
52
53alter table favorites_favorites drop constraint if exists fk_favorites_favorites_favorites_employee_id;
54drop index if exists ix_favorites_favorites_favorites_employee_id;
55
56alter table favorites_favorites drop constraint if exists fk_favorites_favorites_favorites;
57drop index if exists ix_favorites_favorites_favorites;
58
59drop table if exists exact_date;
60
61drop table if exists favorites;
62
63drop table if exists favorites_favorites;
64
65drop table if exists holiday_message;