Class Table

Summary

Fully Qualified Name: CodeIgniter\Database\SQLite3\Table

Description

Class Table

Provides missing features for altering tables that are common in other supported databases, but are missing from SQLite. These are needed in order to support migrations during testing when another database is used as the primary engine, but SQLite in memory databases are used for faster test execution.

Methods

Name Description Defined By
__construct() Table constructor. Table
dropColumn() Drops columns from the table. Table
dropForeignKey() Drops a foreign key from this table so that it won't be recreated in the future. Table
fromTable() Reads an existing database table and collects all of the information needed to recreate this table. Table
modifyColumn() Modifies a field, including changing data type, renaming, etc. Table
run() Called after `fromTable` and any actions, like `dropColumn`, etc, to finalize the action. It creates a temp table, creates the new table with modifications, and copies the data over to the new table. Table

Method Details

__construct()

Table constructor.

Parameter Name Type Description
$db \Connection
$forge \Forge

Returns:

dropColumn()

Drops columns from the table.

Parameter Name Type Description
$columns string|array

Returns: \CodeIgniter\Database\SQLite3\Table

dropForeignKey()

Drops a foreign key from this table so that it won't be recreated in the future.

Parameter Name Type Description
$column string

Returns: \CodeIgniter\Database\SQLite3\Table

fromTable()

Reads an existing database table and collects all of the information needed to recreate this table.

Parameter Name Type Description
$table string

Returns: \CodeIgniter\Database\SQLite3\Table

modifyColumn()

Modifies a field, including changing data type, renaming, etc.

Parameter Name Type Description
$field array

Returns: \CodeIgniter\Database\SQLite3\Table

run()

Called after `fromTable` and any actions, like `dropColumn`, etc, to finalize the action. It creates a temp table, creates the new table with modifications, and copies the data over to the new table.

Returns: bool

Top