code: @Override
      public String generateMigration() throws IOException {
          if (scriptInfo != null) {
              return null;
          }
          if (diff == null) {
              diff();
          }
  
          setOffline();
          String version = null;
          try {
              if (diff.isEmpty()) {
                  logger.info("no changes detected - no migration written");
                  return null;
              }
              // there were actually changes to write
              Migration dbMigration = diff.getMigration();
  
              version = getVersion(migrationModel);
              logger.info("generating migration:{}", version);
              if (!writeMigration(dbMigration, version)) {
                  logger.warn("migration already exists, not generating DDL");
              } else {
                  if (databasePlatform != null) {
                      // writer needs the current model to provide table/column details for
                      // history ddl generation (triggers, history tables etc)
                      DdlWrite write = new DdlWrite(new MConfiguration(), currentModel.read());
                      PlatformDdlWriter writer = createDdlWriter();
                      writer.processMigration(dbMigration, write);
                  }
              }
          } finally {
              if (!online) {
                  DbOffline.reset();
              }
          }
          return null;
      }
docs: {@inheritDoc}