Drop
Dropping tables straightforward in
qb
.Drop a table from the database.
Argument | Type | Required | Default | Description |
table | string | true | | The name of the table to drop. |
options | struct | false | {} | Options to pass to queryExecute . |
execute | boolean | false | true | Run the query immediately after building it. |
Example:
SchemaBuilder
schema.drop( "user_logins" );
SQL (MySQL)
DROP TABLE `user_logins`
Drop a table from the database if it exists.
Argument | Type | Required | Default | Description |
table | string | true | | The name of the table to drop. |
options | struct | false | {} | Options to pass to queryExecute . |
execute | boolean | false | true | Run the query immediately after building it. |
Example:
SchemaBuilder
schema.dropIfExists( "user_logins" );
SQL (MySQL)
DROP TABLE IF EXISTS `user_logins`
Last modified 4mo ago