Record Class SchemaChange

java.lang.Object
java.lang.Record
com.onec.schema.SchemaChange

public record SchemaChange(SchemaChange.Type type, String table, String column, String detail, boolean destructive, List<String> sql) extends Record
One change in a MigrationPlan: what it is, the SQL that performs it, and whether it can lose data (destructive changes are skipped unless onec.schema.allow-destructive=true).
  • Constructor Details

    • SchemaChange

      public SchemaChange(SchemaChange.Type type, String table, String column, String detail, boolean destructive, List<String> sql)
      Creates an instance of a SchemaChange record class.
      Parameters:
      type - the value for the type record component
      table - the value for the table record component
      column - the value for the column record component
      detail - the value for the detail record component
      destructive - the value for the destructive record component
      sql - the value for the sql record component
  • Method Details

    • describe

      public String describe()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • type

      public SchemaChange.Type type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • table

      public String table()
      Returns the value of the table record component.
      Returns:
      the value of the table record component
    • column

      public String column()
      Returns the value of the column record component.
      Returns:
      the value of the column record component
    • detail

      public String detail()
      Returns the value of the detail record component.
      Returns:
      the value of the detail record component
    • destructive

      public boolean destructive()
      Returns the value of the destructive record component.
      Returns:
      the value of the destructive record component
    • sql

      public List<String> sql()
      Returns the value of the sql record component.
      Returns:
      the value of the sql record component