All Downloads are FREE. Search and download functionalities are using the official Maven repository.

evolutions.default.1.sql Maven / Gradle / Ivy

# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions

# --- !Ups

create table test_junction_model (
  id                        bigint auto_increment not null,
  test_model_id             bigint,
  test_other_model_id       bigint,
  constraint pk_test_junction_model primary key (id))
;

create table test_model (
  id                        bigint auto_increment not null,
  my_string                 varchar(255),
  my_date                   timestamp,
  my_date_time              timestamp,
  my_time_stamp             timestamp,
  random_field_crud         varchar(255),
  constraint pk_test_model primary key (id))
;

create table test_nested_model (
  id                        bigint auto_increment not null,
  my_string                 varchar(255),
  my_date                   timestamp,
  my_date_time              timestamp,
  random_field_one_to_many_crud varchar(255),
  test_model_id             bigint,
  constraint pk_test_nested_model primary key (id))
;

create table test_other_model (
  id                        bigint auto_increment not null,
  my_string                 varchar(255),
  my_date                   timestamp,
  my_date_time              timestamp,
  random_field_many_to_many_crud varchar(255),
  test_yet_another_model_id bigint,
  constraint pk_test_other_model primary key (id))
;

create table test_yet_another_model (
  id                        bigint auto_increment not null,
  constraint pk_test_yet_another_model primary key (id))
;

alter table test_junction_model add constraint fk_test_junction_model_testMod_1 foreign key (test_model_id) references test_model (id) on delete restrict on update restrict;
create index ix_test_junction_model_testMod_1 on test_junction_model (test_model_id);
alter table test_junction_model add constraint fk_test_junction_model_testOth_2 foreign key (test_other_model_id) references test_other_model (id) on delete restrict on update restrict;
create index ix_test_junction_model_testOth_2 on test_junction_model (test_other_model_id);
alter table test_nested_model add constraint fk_test_nested_model_testModel_3 foreign key (test_model_id) references test_model (id) on delete restrict on update restrict;
create index ix_test_nested_model_testModel_3 on test_nested_model (test_model_id);
alter table test_other_model add constraint fk_test_other_model_testYetAno_4 foreign key (test_yet_another_model_id) references test_yet_another_model (id) on delete restrict on update restrict;
create index ix_test_other_model_testYetAno_4 on test_other_model (test_yet_another_model_id);



# --- !Downs

SET REFERENTIAL_INTEGRITY FALSE;

drop table if exists test_junction_model;

drop table if exists test_model;

drop table if exists test_nested_model;

drop table if exists test_other_model;

drop table if exists test_yet_another_model;

SET REFERENTIAL_INTEGRITY TRUE;





© 2015 - 2025 Weber Informatics LLC | Privacy Policy