text: alter table combo drop foreign key FK5A7318E69CBC6D5;
  alter table combo drop foreign key FK5A7318EFCE9A7E1;
  alter table combo drop foreign key FK5A7318EF93C805D;
  alter table combo drop foreign key FK5A7318E63A4BBD2;
  alter table doc drop foreign key FK1853897381E73;
  alter table doc drop foreign key FK185381FC434AE;
  alter table doc drop foreign key FK185387758376B;
  alter table doc_context drop foreign key FK30EBA9A8C7230C87;
  alter table identifier drop foreign key FK9F88ACA9F1F42470;
  alter table identifier_occurrence drop foreign key FKF0533F279B08D7A5;
  alter table identifier_occurrence drop foreign key FKF0533F27CDDD0AFF;
  alter table identifier_occurrence drop foreign key FKF0533F279DF8E280;
  alter table identifier_occurrence drop foreign key FKF0533F27B37DC426;
  alter table issue_entitlement drop foreign key FK2D45F6C7330B4F5;
  alter table issue_entitlement drop foreign key FK2D45F6C775F8181E;
  alter table issue_entitlement drop foreign key FK2D45F6C72F4A207;
  alter table license drop foreign key FK9F08441F144465;
  alter table license drop foreign key FK9F0844168C2A8DD;
  alter table org_role drop foreign key FK4E5C38F16D6B9898;
  alter table org_role drop foreign key FK4E5C38F1E646D31D;
  alter table org_role drop foreign key FK4E5C38F199CCEB1A;
  alter table org_role drop foreign key FK4E5C38F1879D5409;
  alter table org_role drop foreign key FK4E5C38F14F370323;
  alter table org_role drop foreign key FK4E5C38F11960C01E;
  alter table package drop foreign key FKCFE534462A381B57;
  alter table package drop foreign key FKCFE53446E9794A2B;
  alter table package drop foreign key FKCFE53446EB68C0AA;
  alter table package drop foreign key FKCFE5344692580D5F;
  alter table platform drop foreign key FK6FBD68736DC6881C;
  alter table platform drop foreign key FK6FBD6873E3F2DAD4;
  alter table platformtipp drop foreign key FK9544A28C581DD6E;
  alter table platformtipp drop foreign key FK9544A2810252C57;
  alter table refdata_value drop foreign key FKF33A596F18DAEBF6;
  alter table subscription drop foreign key FK1456591D7D96D7D2;
  alter table subscription drop foreign key FK1456591D530432B4;
  alter table subscription drop foreign key FK1456591D6297706B;
  alter table subscription drop foreign key FK1456591DE82AEB63;
  alter table subscription_package drop foreign key FK5122C72467963563;
  alter table subscription_package drop foreign key FK5122C7241B1C4D60;
  alter table title_instance drop foreign key FKACC69C334E5D16;
  alter table title_instance drop foreign key FKACC69C66D9594E;
  alter table title_instance_package_platform drop foreign key FKE793FB8F54894D8B;
  alter table title_instance_package_platform drop foreign key FKE793FB8F40E502F5;
  alter table title_instance_package_platform drop foreign key FKE793FB8F80F6588;
  alter table title_instance_package_platform drop foreign key FKE793FB8F810634BB;
  alter table title_instance_package_platform drop foreign key FKE793FB8F16ABD6D1;
  alter table title_instance_package_platform drop foreign key FKE793FB8F3E48CC8E;
  alter table title_instance_package_platform drop foreign key FKE793FB8F922AC05F;
  drop table if exists alert;
  drop table if exists combo;
  drop table if exists dataload_file_instance;
  drop table if exists dataload_file_type;
  drop table if exists doc;
  drop table if exists doc_context;
  drop table if exists identifier;
  drop table if exists identifier_namespace;
  drop table if exists identifier_occurrence;
  drop table if exists issue_entitlement;
  drop table if exists license;
  drop table if exists org;
  drop table if exists org_role;
  drop table if exists package;
  drop table if exists platform;
  drop table if exists platformtipp;
  drop table if exists refdata_category;
  drop table if exists refdata_value;
  drop table if exists subscription;
  drop table if exists subscription_package;
  drop table if exists title_instance;
  drop table if exists title_instance_package_platform;
  create table alert (id bigint not null auto_increment, version bigint not null, primary key (id));
  create table combo (combo_id bigint not null auto_increment, combo_version bigint not null, from_org_id bigint, combo_status_rv_fk bigint, to_org_id bigint, combo_type_rv_fk bigint, primary key (combo_id));
  create table dataload_file_instance (id bigint not null auto_increment, version bigint not null, name varchar(255) not null, upload_timestamp bigint not null, primary key (id));
  create table dataload_file_type (id bigint not null auto_increment, version bigint not null, fl_ft_name varchar(255) not null, primary key (id));
  create table doc (doc_id bigint not null auto_increment, doc_version bigint not null, doc_alert_fk bigint not null, doc_status_rv_fk bigint, doc_type_rv_fk bigint, primary key (doc_id));
  create table doc_context (dc_id bigint not null auto_increment, dc_version bigint not null, dc_doc_fk bigint not null, primary key (dc_id));
  create table identifier (id_id bigint not null auto_increment, version bigint not null, id_ns_fk bigint not null, id_value varchar(255) not null, primary key (id_id));
  create table identifier_namespace (idns_id bigint not null auto_increment, version bigint not null, idns_ns varchar(255) not null, primary key (idns_id));
  create table identifier_occurrence (io_id bigint not null auto_increment, version bigint not null, io_canonical_id bigint not null, io_org_fk bigint, io_ti_fk bigint, io_tipp_fk bigint, primary key (io_id));
  create table issue_entitlement (ie_id bigint not null auto_increment, ie_version bigint not null, ie_core_title bit not null, ie_coverage_depth varchar(255), ie_coverage_note longtext, ie_embargo varchar(255), ie_end_date datetime, ie_end_issue varchar(255), ie_end_volume varchar(255), ie_start_date datetime, ie_start_issue varchar(255), ie_start_volume varchar(255), ie_status_rv_fk bigint, ie_subscription_fk bigint, ie_tipp_fk bigint, primary key (ie_id));
  create table license (lic_id bigint not null auto_increment, lic_version bigint not null, lic_alumni_access varchar(255), lic_concurrent_users varchar(255), lic_coursepack varchar(255), lic_enterprise varchar(255), lic_ill varchar(255), lic_lastmod bigint not null, lic_license_status_str varchar(255), lic_license_type_str varchar(255), lic_license_url varchar(255), lic_licensee_ref varchar(255), lic_licensor_ref varchar(255), lic_multisite_access varchar(255), lic_notice_period varchar(255), lic_partners_access varchar(255), lic_pca varchar(255), lic_ref varchar(255), lic_remote_access varchar(255), lic_status_rv_fk bigint, lic_type_rv_fk bigint, lic_vle varchar(255), lic_walkin_access varchar(255), primary key (lic_id));
  create table org (org_id bigint not null auto_increment, org_version bigint not null, org_address longtext, org_imp_id varchar(255) not null, org_ip_range longtext, org_name varchar(255) not null, sector varchar(128), primary key (org_id));
  create table org_role (or_id bigint not null auto_increment, or_version bigint not null, or_lic_fk bigint, or_org_fk bigint not null, or_pkg_fk bigint, or_roletype_fk bigint, or_sub_fk bigint, or_title_fk bigint, primary key (or_id));
  create table package (pkg_id bigint not null auto_increment, pkg_version bigint not null, content_provider_id bigint, pkg_identifier varchar(255) not null, pkg_imp_id varchar(255) not null, pkg_name varchar(255) not null, pkg_nominal_platform_fk bigint, pkg_status_rv_fk bigint, pkg_type_rv_fk bigint, primary key (pkg_id));
  create table platform (plat_id bigint not null auto_increment, plat_version bigint not null, plat_imp_id varchar(255), plat_name varchar(255) not null, plat_normalised_name varchar(255) not null, plat_primary_url varchar(255), plat_data_provenance varchar(255), plat_status_rv_fk bigint, plat_type_rv_fk bigint, primary key (plat_id));
  create table platformtipp (id bigint not null auto_increment, version bigint not null, platform_id bigint not null, rel varchar(255), tipp_id bigint not null, title_url varchar(255), primary key (id));
  create table refdata_category (rdc_id bigint not null auto_increment, rdc_version bigint not null, rdc_description varchar(255) not null, primary key (rdc_id));
  create table refdata_value (rdv_id bigint not null auto_increment, rdv_version bigint not null, rdv_owner bigint not null, rdv_value varchar(255) not null, primary key (rdv_id));
  create table subscription (sub_id bigint not null auto_increment, sub_version bigint not null, sub_end_date datetime, sub_identifier varchar(255) not null, sub_imp_id varchar(255), sub_parent_sub_fk bigint, sub_name varchar(255) not null, sub_notice_period varchar(255), sub_owner_license_fk bigint, sub_start_date datetime, sub_status_rv_fk bigint, sub_type_rv_fk bigint, primary key (sub_id));
  create table subscription_package (sp_id bigint not null auto_increment, sp_version bigint not null, sp_pkg_fk bigint, sp_sub_fk bigint, primary key (sp_id));
  create table title_instance (ti_id bigint not null auto_increment, ti_version bigint not null, ti_imp_id varchar(255) not null, ti_status_rv_fk bigint, ti_title varchar(255) not null, ti_type_rv_fk bigint, primary key (ti_id));
  create table title_instance_package_platform (tipp_id bigint not null auto_increment, tipp_version bigint not null, tipp_coverage_depth varchar(255), tipp_coverage_note longtext, tipp_derived_from bigint, tipp_embargo varchar(255), tipp_end_date datetime, tipp_end_issue varchar(255), tipp_end_volume varchar(255), tipp_host_platform_url varchar(255), tipp_imp_id varchar(255), tipp_option_rv_fk bigint, tipp_pkg_fk bigint not null, tipp_plat_fk bigint not null, tipp_rectype varchar(255) not null, tipp_start_date datetime, tipp_start_issue varchar(255), tipp_start_volume varchar(255), tipp_status_rv_fk bigint, tipp_sub_fk bigint, tipp_ti_fk bigint not null, primary key (tipp_id));
  alter table combo add index FK5A7318E69CBC6D5 (combo_status_rv_fk), add constraint FK5A7318E69CBC6D5 foreign key (combo_status_rv_fk) references refdata_value (rdv_id);
  alter table combo add index FK5A7318EFCE9A7E1 (to_org_id), add constraint FK5A7318EFCE9A7E1 foreign key (to_org_id) references org (org_id);
  alter table combo add index FK5A7318EF93C805D (combo_type_rv_fk), add constraint FK5A7318EF93C805D foreign key (combo_type_rv_fk) references refdata_value (rdv_id);
  alter table combo add index FK5A7318E63A4BBD2 (from_org_id), add constraint FK5A7318E63A4BBD2 foreign key (from_org_id) references org (org_id);
  alter table doc add index FK1853897381E73 (doc_type_rv_fk), add constraint FK1853897381E73 foreign key (doc_type_rv_fk) references refdata_value (rdv_id);
  alter table doc add index FK185381FC434AE (doc_alert_fk), add constraint FK185381FC434AE foreign key (doc_alert_fk) references alert (id);
  alter table doc add index FK185387758376B (doc_status_rv_fk), add constraint FK185387758376B foreign key (doc_status_rv_fk) references refdata_value (rdv_id);
  alter table doc_context add index FK30EBA9A8C7230C87 (dc_doc_fk), add constraint FK30EBA9A8C7230C87 foreign key (dc_doc_fk) references doc (doc_id);
  create index id_value_idx on identifier (id_ns_fk, id_value);
  alter table identifier add index FK9F88ACA9F1F42470 (id_ns_fk), add constraint FK9F88ACA9F1F42470 foreign key (id_ns_fk) references identifier_namespace (idns_id);
  alter table identifier_occurrence add index FKF0533F279B08D7A5 (io_canonical_id), add constraint FKF0533F279B08D7A5 foreign key (io_canonical_id) references identifier (id_id);
  alter table identifier_occurrence add index FKF0533F27CDDD0AFF (io_tipp_fk), add constraint FKF0533F27CDDD0AFF foreign key (io_tipp_fk) references title_instance_package_platform (tipp_id);
  alter table identifier_occurrence add index FKF0533F279DF8E280 (io_org_fk), add constraint FKF0533F279DF8E280 foreign key (io_org_fk) references org (org_id);
  alter table identifier_occurrence add index FKF0533F27B37DC426 (io_ti_fk), add constraint FKF0533F27B37DC426 foreign key (io_ti_fk) references title_instance (ti_id);
  alter table issue_entitlement add index FK2D45F6C7330B4F5 (ie_tipp_fk), add constraint FK2D45F6C7330B4F5 foreign key (ie_tipp_fk) references title_instance_package_platform (tipp_id);
  alter table issue_entitlement add index FK2D45F6C775F8181E (ie_subscription_fk), add constraint FK2D45F6C775F8181E foreign key (ie_subscription_fk) references subscription (sub_id);
  alter table issue_entitlement add index FK2D45F6C72F4A207 (ie_status_rv_fk), add constraint FK2D45F6C72F4A207 foreign key (ie_status_rv_fk) references refdata_value (rdv_id);
  alter table license add index FK9F08441F144465 (lic_type_rv_fk), add constraint FK9F08441F144465 foreign key (lic_type_rv_fk) references refdata_value (rdv_id);
  alter table license add index FK9F0844168C2A8DD (lic_status_rv_fk), add constraint FK9F0844168C2A8DD foreign key (lic_status_rv_fk) references refdata_value (rdv_id);
  create index org_imp_id_idx on org (org_imp_id);
  create index org_name_idx on org (org_name);
  alter table org_role add index FK4E5C38F16D6B9898 (or_title_fk), add constraint FK4E5C38F16D6B9898 foreign key (or_title_fk) references title_instance (ti_id);
  alter table org_role add index FK4E5C38F1E646D31D (or_pkg_fk), add constraint FK4E5C38F1E646D31D foreign key (or_pkg_fk) references package (pkg_id);
  alter table org_role add index FK4E5C38F199CCEB1A (or_sub_fk), add constraint FK4E5C38F199CCEB1A foreign key (or_sub_fk) references subscription (sub_id);
  alter table org_role add index FK4E5C38F1879D5409 (or_roletype_fk), add constraint FK4E5C38F1879D5409 foreign key (or_roletype_fk) references refdata_value (rdv_id);
  alter table org_role add index FK4E5C38F14F370323 (or_org_fk), add constraint FK4E5C38F14F370323 foreign key (or_org_fk) references org (org_id);
  alter table org_role add index FK4E5C38F11960C01E (or_lic_fk), add constraint FK4E5C38F11960C01E foreign key (or_lic_fk) references license (lic_id);
  create index pkg_imp_id_idx on package (pkg_imp_id);
  alter table package add index FKCFE534462A381B57 (pkg_status_rv_fk), add constraint FKCFE534462A381B57 foreign key (pkg_status_rv_fk) references refdata_value (rdv_id);
  alter table package add index FKCFE53446E9794A2B (pkg_nominal_platform_fk), add constraint FKCFE53446E9794A2B foreign key (pkg_nominal_platform_fk) references platform (plat_id);
  alter table package add index FKCFE53446EB68C0AA (content_provider_id), add constraint FKCFE53446EB68C0AA foreign key (content_provider_id) references org (org_id);
  alter table package add index FKCFE5344692580D5F (pkg_type_rv_fk), add constraint FKCFE5344692580D5F foreign key (pkg_type_rv_fk) references refdata_value (rdv_id);
  create index plat_imp_id_idx on platform (plat_imp_id);
  alter table platform add index FK6FBD68736DC6881C (plat_type_rv_fk), add constraint FK6FBD68736DC6881C foreign key (plat_type_rv_fk) references refdata_value (rdv_id);
  alter table platform add index FK6FBD6873E3F2DAD4 (plat_status_rv_fk), add constraint FK6FBD6873E3F2DAD4 foreign key (plat_status_rv_fk) references refdata_value (rdv_id);
  alter table platformtipp add index FK9544A28C581DD6E (tipp_id), add constraint FK9544A28C581DD6E foreign key (tipp_id) references title_instance_package_platform (tipp_id);
  alter table platformtipp add index FK9544A2810252C57 (platform_id), add constraint FK9544A2810252C57 foreign key (platform_id) references platform (plat_id);
  create index rdc_description_idx on refdata_category (rdc_description);
  create index rdv_entry_idx on refdata_value (rdv_owner, rdv_value);
  alter table refdata_value add index FKF33A596F18DAEBF6 (rdv_owner), add constraint FKF33A596F18DAEBF6 foreign key (rdv_owner) references refdata_category (rdc_id);
  alter table subscription add index FK1456591D7D96D7D2 (sub_owner_license_fk), add constraint FK1456591D7D96D7D2 foreign key (sub_owner_license_fk) references license (lic_id);
  alter table subscription add index FK1456591D530432B4 (sub_parent_sub_fk), add constraint FK1456591D530432B4 foreign key (sub_parent_sub_fk) references subscription (sub_id);
  alter table subscription add index FK1456591D6297706B (sub_type_rv_fk), add constraint FK1456591D6297706B foreign key (sub_type_rv_fk) references refdata_value (rdv_id);
  alter table subscription add index FK1456591DE82AEB63 (sub_status_rv_fk), add constraint FK1456591DE82AEB63 foreign key (sub_status_rv_fk) references refdata_value (rdv_id);
  alter table subscription_package add index FK5122C72467963563 (sp_pkg_fk), add constraint FK5122C72467963563 foreign key (sp_pkg_fk) references package (pkg_id);
  alter table subscription_package add index FK5122C7241B1C4D60 (sp_sub_fk), add constraint FK5122C7241B1C4D60 foreign key (sp_sub_fk) references subscription (sub_id);
  create index ti_imp_id_idx on title_instance (ti_imp_id);
  alter table title_instance add index FKACC69C334E5D16 (ti_type_rv_fk), add constraint FKACC69C334E5D16 foreign key (ti_type_rv_fk) references refdata_value (rdv_id);
  alter table title_instance add index FKACC69C66D9594E (ti_status_rv_fk), add constraint FKACC69C66D9594E foreign key (ti_status_rv_fk) references refdata_value (rdv_id);
  create index tipp_idx on title_instance_package_platform (tipp_pkg_fk, tipp_plat_fk, tipp_ti_fk);
  create index tipp_imp_id_idx on title_instance_package_platform (tipp_imp_id);
  alter table title_instance_package_platform add index FKE793FB8F54894D8B (tipp_pkg_fk), add constraint FKE793FB8F54894D8B foreign key (tipp_pkg_fk) references package (pkg_id);
  alter table title_instance_package_platform add index FKE793FB8F40E502F5 (tipp_ti_fk), add constraint FKE793FB8F40E502F5 foreign key (tipp_ti_fk) references title_instance (ti_id);
  alter table title_instance_package_platform add index FKE793FB8F80F6588 (tipp_sub_fk), add constraint FKE793FB8F80F6588 foreign key (tipp_sub_fk) references subscription (sub_id);
  alter table title_instance_package_platform add index FKE793FB8F810634BB (tipp_plat_fk), add constraint FKE793FB8F810634BB foreign key (tipp_plat_fk) references platform (plat_id);
  alter table title_instance_package_platform add index FKE793FB8F16ABD6D1 (tipp_option_rv_fk), add constraint FKE793FB8F16ABD6D1 foreign key (tipp_option_rv_fk) references refdata_value (rdv_id);
  alter table title_instance_package_platform add index FKE793FB8F3E48CC8E (tipp_status_rv_fk), add constraint FKE793FB8F3E48CC8E foreign key (tipp_status_rv_fk) references refdata_value (rdv_id);
  alter table title_instance_package_platform add index FKE793FB8F922AC05F (tipp_derived_from), add constraint FKE793FB8F922AC05F foreign key (tipp_derived_from) references title_instance_package_platform (tipp_id);
  