dropIndex

abstract fun dropIndex(indexName: String)

Drops an existing index from the database.

This function generates and executes a DROP INDEX IF EXISTS SQL statement. Using IF EXISTS ensures that the operation completes without error even if the specified index does not exist.

Example:

// Assuming an index named "idx_name_city" was created earlier
schema.dropIndex("idx_name_city")

This will execute an SQL statement similar to: DROP INDEX IF EXISTS "idx_name_city";

Author

MOHAMMAD AZIM ANSARI

Parameters

indexName

The name of the index to be dropped. The name will be properly escaped to prevent SQL injection issues.

See also

Throws

if an error occurs while dropping the index.