alter Table
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")Content copied to clipboard
Example of adding a column:
schema.alterTable(UserTable).addColumn(UserTable.newColumn)Content copied to clipboard
Example of dropping a column:
schema.alterTable(UserTable).dropColumn("obsolete_column_name")Content copied to clipboard
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.