DatabaseTruncation
trait DatabaseTruncation (View source)
Traits
Properties
static protected array | $allTables | The cached names of the database tables for each connection. |
Methods
The parameters that should be used when running "migrate:fresh".
Determine if views should be dropped when refreshing the database.
Determine if types should be dropped when refreshing the database.
Determine if the seed task should be run when refreshing the database.
Determine the specific seeder class that should be used when refreshing the database.
Truncate the database tables for all configured connections.
Truncate the database tables for all configured connections.
Truncate the database tables for the given database connection.
Get all the tables that belong to the connection.
Determine if a table exists in the given list, with or without its schema.
The database connections that should have their tables truncated.
Get the tables that should be truncated.
Get the tables that should not be truncated.
Perform any work that should take place before the database has started truncating.
Perform any work that should take place once the database has finished truncating.
Details
protected array
migrateFreshUsing()
The parameters that should be used when running "migrate:fresh".
protected bool
shouldDropViews()
Determine if views should be dropped when refreshing the database.
protected bool
shouldDropTypes()
Determine if types should be dropped when refreshing the database.
protected bool
shouldSeed()
Determine if the seed task should be run when refreshing the database.
protected mixed
seeder()
Determine the specific seeder class that should be used when refreshing the database.
protected void
truncateDatabaseTables()
Truncate the database tables for all configured connections.
protected void
truncateTablesForAllConnections()
Truncate the database tables for all configured connections.
protected void
truncateTablesForConnection(ConnectionInterface $connection, string|null $name)
Truncate the database tables for the given database connection.
protected array
getAllTablesForConnection(ConnectionInterface $connection, string|null $name)
Get all the tables that belong to the connection.
protected bool
tableExistsIn(array $table, array $tables)
Determine if a table exists in the given list, with or without its schema.
protected array
connectionsToTruncate()
The database connections that should have their tables truncated.
protected array|null
tablesToTruncate(ConnectionInterface $connection, string|null $connectionName)
Get the tables that should be truncated.
protected array
exceptTables(ConnectionInterface $connection, string|null $connectionName)
Get the tables that should not be truncated.
protected void
beforeTruncatingDatabase()
Perform any work that should take place before the database has started truncating.
protected void
afterTruncatingDatabase()
Perform any work that should take place once the database has finished truncating.