Class AlterTable

    • Method Detail

      • table

        public static AlterTable table​(@NonNull
                                       @NonNull SQLElement table)
        Static method for constructing an AlterTable statement given the table being altered.
        Parameters:
        table - the table
        Returns:
        the AlterTable statement
      • action

        public AlterTable action​(@NonNull
                                 @NonNull AlterTableAction action)
        Adds an action to the statement.
        Parameters:
        action - the action
        Returns:
        the AlterTable statement
      • alterColumn

        public AlterTable alterColumn​(@NonNull
                                      @NonNull Column column)
        Adds an alter column action which updates the column based on the given column definition.
        Parameters:
        column - the column with new a definition
        Returns:
        the AlterTable statement
      • dropColumn

        public AlterTable dropColumn​(String name)
        Adds a drop column action to drop the column with the given name
        Parameters:
        name - the name of the column to drop
        Returns:
        the AlterTable statement
      • renameColumn

        public AlterTable renameColumn​(String oldName,
                                       String newName)
        Adds a rename column action to rename the old name column to new name
        Parameters:
        oldName - the old name of the column
        newName - the new name of the column
        Returns:
        the AlterTable statement
      • renameTable

        public AlterTable renameTable​(String newName)
        Adds a rename table action to rename the table to new name
        Parameters:
        newName - the new name of the table
        Returns:
        the AlterTable statement