DotConnect dc = new DotConnect();
dc.setSQL( "select 1 from user_tables where table_name = 'PUBLISHING_BUNDLE'" );
StringBuilder query = new StringBuilder();
try {
List<Map<String, Object>> res = dc.loadObjectResults();
if(res.isEmpty()) {
query.append("create table publishing_bundle(id varchar2(36) NOT NULL primary key,name varchar2(255) NOT NULL,publish_date TIMESTAMP,expire_date TIMESTAMP,owner varchar2(100));\n");
query.append("create table publishing_bundle_environment(id varchar2(36) NOT NULL primary key,bundle_id varchar2(36) NOT NULL,environment_id varchar2(36) NOT NULL);\n");
query.append("alter table publishing_bundle_environment add constraint FK_bundle_id foreign key (bundle_id) references publishing_bundle(id);\n");
query.append("alter table publishing_bundle_environment add constraint FK_environment_id foreign key (environment_id) references publishing_environment(id);\n");