Esempio n. 1
0
 private void createCmdbuildStructure() {
   Log.CMDBUILD.info("Creating CMDBuild structure");
   final List<String> sqlFiles =
       Arrays.asList( //
           baseSqlPath + "01_system_functions_base.sql", //
           baseSqlPath + "02_system_functions_class.sql", //
           baseSqlPath + "03_system_functions_attribute.sql", //
           baseSqlPath + "04_system_functions_domain.sql", //
           baseSqlPath + "05_base_tables.sql", //
           baseSqlPath + "06_system_views_base.sql", //
           baseSqlPath + "07_support_tables.sql", //
           baseSqlPath + "08_user_tables.sql", //
           baseSqlPath + "09_system_views_extras.sql", //
           baseSqlPath + "10_system_functions_extras.sql", //
           baseSqlPath + "11_workflow.sql", //
           baseSqlPath + "12_tecnoteca_extras.sql", //
           baseSqlPath + "13_bim.sql");
   for (final String file : sqlFiles) {
     Log.CMDBUILD.info("applying '{}'", file);
     final String content = FileUtils.getContents(file);
     new JdbcTemplate(systemDataSource()).execute(content);
   }
 }
Esempio n. 2
0
 private void createSharkTables() {
   Log.CMDBUILD.info("Creating shark tables");
   new JdbcTemplate(sharkDataSource())
       .execute(FileUtils.getContents(sharkSqlPath + "02_shark_emptydb.sql"));
 }
Esempio n. 3
0
 private void restoreSampleDB() {
   Log.CMDBUILD.info("Restoring demo structure");
   final String filename = sampleSqlPath + configuration.getDatabaseType() + "_schema.sql";
   final String sql = FileUtils.getContents(filename);
   new JdbcTemplate(systemDataSource()).execute(sql);
 }