Beispiel #1
0
 public void deleteAllSnapshots() {
   logger.debug("deleteAllSnapshots()");
   try {
     dataSource.execute("truncate table snapshot");
   } catch (SQLException e) {
     logger.error(e.getMessage(), e);
   }
 }
Beispiel #2
0
 private static void upgradeSnapshotTable(DataSource dataSource) throws SQLException {
   if (!dataSource.tableExists("snapshot")) {
     return;
   }
   // 'headline' column renamed to 'grouping'
   for (Column column : dataSource.getColumns("snapshot")) {
     if (column.getName().equals("headline")) {
       dataSource.execute("alter table snapshot alter column headline rename to" + " grouping");
       break;
     }
   }
 }