-- begin TMS_TERMINAL
alter table TMS_TERMINAL add constraint FK_TMS_TERMINAL_ON_PROFILE foreign key (PROFILE_ID) references TMS_PROFILE(ID)^
create unique index IDX_TMS_TERMINAL_UNIQ_TERMINAL_ID on TMS_TERMINAL (TERMINAL_ID) ^
create index IDX_TMS_TERMINAL_ON_PROFILE on TMS_TERMINAL (PROFILE_ID)^
-- end TMS_TERMINAL
-- begin TMS_APPLICATION
alter table TMS_APPLICATION add constraint FK_TMS_APPLICATION_ON_APK foreign key (APK_ID) references SYS_FILE(ID)^
create index IDX_TMS_APPLICATION_ON_APK on TMS_APPLICATION (APK_ID)^
-- end TMS_APPLICATION

-- begin TMS_ISSUER
alter table TMS_ISSUER add constraint FK_TMS_ISSUER_ON_ACQUIRER foreign key (ACQUIRER_ID) references TMS_ACQUIRER(ID)^
create index IDX_TMS_ISSUER_ON_ACQUIRER on TMS_ISSUER (ACQUIRER_ID)^
-- end TMS_ISSUER
-- begin TMS_ACQUIRER
alter table TMS_ACQUIRER add constraint FK_TMS_ACQUIRER_ON_TLE_SETTING foreign key (TLE_SETTING_ID) references TMS_TLE_SETTING(ID)^
alter table TMS_ACQUIRER add constraint FK_TMS_ACQUIRER_ON__TERMINAL foreign key (_TERMINAL_ID) references TMS_TERMINAL(ID)^
create index IDX_TMS_ACQUIRER_ON_TLE_SETTING on TMS_ACQUIRER (TLE_SETTING_ID)^
create index IDX_TMS_ACQUIRER_ON__TERMINAL on TMS_ACQUIRER (_TERMINAL_ID)^
-- end TMS_ACQUIRER
-- begin TMS_PROFILE
alter table TMS_PROFILE add constraint FK_TMS_PROFILE_ON_TERMINAL foreign key (TERMINAL_ID) references TMS_TERMINAL(ID)^
create unique index IDX_TMS_PROFILE_UNIQ_CODE on TMS_PROFILE (CODE) ^
create index IDX_TMS_PROFILE_ON_TERMINAL on TMS_PROFILE (TERMINAL_ID)^
-- end TMS_PROFILE
-- begin TMS_TLE_SETTING
create unique index IDX_TMS_TLE_SETTING_UNIQ_TLE_EFT_SEC on TMS_TLE_SETTING (TLE_EFT_SEC) ^
-- end TMS_TLE_SETTING
-- begin TMS_DEVICE
create unique index IDX_TMS_DEVICE_UNIQ_IMEI on TMS_DEVICE (IMEI) ^
create unique index IDX_TMS_DEVICE_UNIQ_SN on TMS_DEVICE (SN) ^
-- end TMS_DEVICE
-- begin TMS_TERMINAL_USER
alter table TMS_TERMINAL_USER add constraint FK_TMS_TERMINAL_USER_ON_TERMINAL foreign key (TERMINAL_ID) references TMS_TERMINAL(ID)^
create index IDX_TMS_TERMINAL_USER_ON_TERMINAL on TMS_TERMINAL_USER (TERMINAL_ID)^
-- end TMS_TERMINAL_USER
-- begin TMS_DEVICE_TERMINAL
alter table TMS_DEVICE_TERMINAL add constraint FK_TMS_DEVICE_TERMINAL_ON_DEVICE foreign key (DEVICE_ID) references TMS_DEVICE(ID)^
alter table TMS_DEVICE_TERMINAL add constraint FK_TMS_DEVICE_TERMINAL_ON_TERMINAL foreign key (TERMINAL_ID) references TMS_TERMINAL(ID)^
create unique index IDX_TMS_DEVICE_TERMINAL_UNQ on TMS_DEVICE_TERMINAL (DEVICE_ID, TERMINAL_ID) ^
create index IDX_TMS_DEVICE_TERMINAL_ON_DEVICE on TMS_DEVICE_TERMINAL (DEVICE_ID)^
create index IDX_TMS_DEVICE_TERMINAL_ON_TERMINAL on TMS_DEVICE_TERMINAL (TERMINAL_ID)^
-- end TMS_DEVICE_TERMINAL
-- begin TMS_DEVICE_LOCATION
alter table TMS_DEVICE_LOCATION add constraint FK_TMS_DEVICE_LOCATION_ON_DEVICE foreign key (DEVICE_ID) references TMS_DEVICE(ID)^
create index IDX_TMS_DEVICE_LOCATION_ON_DEVICE on TMS_DEVICE_LOCATION (DEVICE_ID)^
-- end TMS_DEVICE_LOCATION
-- begin TMS_PUBLIC_KEY_SETTING
create unique index IDX_TMS_PUBLIC_KEY_SETTING_UNIQ_IDX on TMS_PUBLIC_KEY_SETTING (IDX) ^
-- end TMS_PUBLIC_KEY_SETTING
-- begin TMS_APPLICATION_THIRD_PARTY
alter table TMS_APPLICATION_THIRD_PARTY add constraint FK_TMS_APPLICATION_THIRD_PARTY_ON_APK foreign key (APK_ID) references SYS_FILE(ID)^
create index IDX_TMS_APPLICATION_THIRD_PARTY_ON_APK on TMS_APPLICATION_THIRD_PARTY (APK_ID)^
-- end TMS_APPLICATION_THIRD_PARTY
-- begin TMS_APPLICATION_INTENT
alter table TMS_APPLICATION_INTENT add constraint FK_TMS_APPLICATION_INTENT_ON_APPLICATION foreign key (APPLICATION_ID) references TMS_APPLICATION(ID)^
alter table TMS_APPLICATION_INTENT add constraint FK_TMS_APPLICATION_INTENT_ON_ICON foreign key (ICON_ID) references SYS_FILE(ID)^
create index IDX_TMS_APPLICATION_INTENT_ON_APPLICATION on TMS_APPLICATION_INTENT (APPLICATION_ID)^
create index IDX_TMS_APPLICATION_INTENT_ON_ICON on TMS_APPLICATION_INTENT (ICON_ID)^
-- end TMS_APPLICATION_INTENT
-- begin TMS_LAUNCHER_SETTING
alter table TMS_LAUNCHER_SETTING add constraint FK_TMS_LAUNCHER_SETTING_ON_MAIN_BANNER_IMAGE foreign key (MAIN_BANNER_IMAGE_ID) references SYS_FILE(ID)^
create unique index IDX_TMS_LAUNCHER_SETTING_UNIQ_CODE on TMS_LAUNCHER_SETTING (CODE) ^
create index IDX_TMS_LAUNCHER_SETTING_ON_MAIN_BANNER_IMAGE on TMS_LAUNCHER_SETTING (MAIN_BANNER_IMAGE_ID)^
-- end TMS_LAUNCHER_SETTING
-- begin TMS_ISSUER_CARD_LINK
alter table TMS_ISSUER_CARD_LINK add constraint FK_ISSCAR_ON_ISSUER foreign key (ISSUER_ID) references TMS_ISSUER(ID)^
alter table TMS_ISSUER_CARD_LINK add constraint FK_ISSCAR_ON_CARD foreign key (CARD_ID) references TMS_CARD(ID)^
-- end TMS_ISSUER_CARD_LINK
-- begin TMS_PROFILE_APPLICATION_THIRD_PARTY_LINK
alter table TMS_PROFILE_APPLICATION_THIRD_PARTY_LINK add constraint FK_PROAPPTHIPAR_ON_APPLICATION_THIRD_PARTY foreign key (APPLICATION_THIRD_PARTY_ID) references TMS_APPLICATION_THIRD_PARTY(ID)^
alter table TMS_PROFILE_APPLICATION_THIRD_PARTY_LINK add constraint FK_PROAPPTHIPAR_ON_PROFILE foreign key (PROFILE_ID) references TMS_PROFILE(ID)^
-- end TMS_PROFILE_APPLICATION_THIRD_PARTY_LINK
-- begin TMS_PROFILE_APPLICATION_LINK
alter table TMS_PROFILE_APPLICATION_LINK add constraint FK_PROAPP_ON_APPLICATION foreign key (APPLICATION_ID) references TMS_APPLICATION(ID)^
alter table TMS_PROFILE_APPLICATION_LINK add constraint FK_PROAPP_ON_PROFILE foreign key (PROFILE_ID) references TMS_PROFILE(ID)^
-- end TMS_PROFILE_APPLICATION_LINK
-- begin TMS_PROFILE_APPLICATION_INTENT_LINK
alter table TMS_PROFILE_APPLICATION_INTENT_LINK add constraint FK_PROAPPINT_ON_PROFILE foreign key (PROFILE_ID) references TMS_PROFILE(ID)^
alter table TMS_PROFILE_APPLICATION_INTENT_LINK add constraint FK_PROAPPINT_ON_APPLICATION_INTENT foreign key (APPLICATION_INTENT_ID) references TMS_APPLICATION_INTENT(ID)^
-- end TMS_PROFILE_APPLICATION_INTENT_LINK
