001package io.ebeaninternal.dbmigration.ddlgeneration.platform;
002
003import io.ebean.config.DatabaseConfig;
004import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite;
005import io.ebeaninternal.dbmigration.migration.AddHistoryTable;
006import io.ebeaninternal.dbmigration.migration.DropHistoryTable;
007import io.ebeaninternal.dbmigration.model.MTable;
008
009import java.io.IOException;
010
011/**
012 * Defines the implementation for adding history support to a table.
013 */
014public interface PlatformHistoryDdl {
015
016  /**
017   * Configure typically reading the necessary parameters from DatabaseConfig and Platform.
018   */
019  void configure(DatabaseConfig config, PlatformDdl platformDdl);
020
021  /**
022   * Creates a new table and add history support to the table using platform specific mechanism.
023   */
024  void createWithHistory(DdlWrite writer, MTable table) throws IOException;
025
026  /**
027   * Drop history support for the given table.
028   */
029  void dropHistoryTable(DdlWrite writer, DropHistoryTable dropHistoryTable) throws IOException;
030
031  /**
032   * Add history support to the given table.
033   */
034  void addHistoryTable(DdlWrite writer, AddHistoryTable addHistoryTable) throws IOException;
035
036  /**
037   * Regenerate the history triggers/stored function due to column added/dropped/included or excluded.
038   */
039  void updateTriggers(DdlWrite write, HistoryTableUpdate baseTable) throws IOException;
040}