LogoLogo
6.4.0
6.4.0
  • Introduction
  • What's New?
  • Installation & Usage
  • Migration Guide
  • Contributing & Filing Issues
  • Contributors
  • Query Builder
    • Return Format
    • Interception Points
    • Retrieving Results
    • Aggregates
    • Selects
    • From
    • Joins
    • Where Clauses
    • Conditionals
    • Ordering, Grouping & Limit
    • Unions
    • Common Table Expressions (i.e. CTEs)
    • Inserts
    • Updates
    • Deletes
    • New Query
    • Clone
  • Schema Builder
    • Overview
    • Create
    • Columns
    • Column Modifiers
    • Column Constraints
    • Creating Table Constraints
    • Alter
    • Drop
Powered by GitBook
On this page
  • drop
  • dropIfExists

Was this helpful?

Edit on Git
Export as PDF
  1. Schema Builder

Drop

PreviousAlter

Last updated 7 years ago

Was this helpful?

Dropping tables straightforward in qb.

For dropping columns or constraints, see .

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

schema.drop( "user_logins" );

SQL (MySQL)

DROP TABLE `user_logins`

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

schema.dropIfExists( "user_logins" );

SQL (MySQL)

DROP TABLE IF EXISTS `user_logins`
Alter