alterTable

abstract fun alterTable(table: KQLiteTable): AlterTable

Initiates an ALTER TABLE operation on a specified table.

This function returns an AlterTable builder object, which provides methods to perform various table alterations, such as adding or dropping columns, or renaming the table. The operations are chained on the returned object.

Example of renaming a table:

schema.alterTable(OldUserTable).renameTable("users_old", "NewUserTable")

Example of adding a column:

schema.alterTable(UserTable).addColumn(UserTable.newColumn)

Example of dropping a column:

schema.alterTable(UserTable).dropColumn("obsolete_column_name")

Return

An AlterTable instance that can be used to define and execute the alteration.

Author

MOHAMMAD AZIM ANSARI

Parameters

table

The KQLiteTable object representing the table to be altered.

See also

Throws

if an error occurs during the alteration process.