Search…
8.7.0
Introduction
What's New?
Installation & Usage
Migration Guide
Contributing & Filing Issues
Query Builder
Getting a New Query
Building Queries
Executing Queries
Options and Utilities
Debugging
Schema Builder
Overview
Create
Columns
Column Modifiers
Column Constraints
Creating Table Constraints
Alter
Drop
External Links
API Docs
Source Code
Issue Tracker
Powered By
GitBook
Drop
Dropping tables straightforward in
qb
.
For dropping columns or constraints, see
Alter
.
drop
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
1
schema
.
drop
(
"user_logins"
);
Copied!
SQL (MySQL)
1
DROP
TABLE
`
user_logins
`
Copied!
dropIfExists
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
1
schema
.
dropIfExists
(
"user_logins"
);
Copied!
SQL (MySQL)
1
DROP
TABLE
IF
EXISTS
`
user_logins
`
Copied!
Schema Builder - Previous
Alter
Last modified
4yr ago
Copy link
Edit on GitHub
Contents
drop
dropIfExists