Property | Type | Description | |
---|---|---|---|
$db_char_set | string | Database character set | |
$fields | array | Fields data | |
$keys | array | Keys data | |
$primary_keys | array | Primary Keys data |
Property | Type | Description | |
---|---|---|---|
$_create_database | string | CREATE DATABASE statement | |
$_create_table | string | CREATE TABLE statement | |
$_create_table_if | string | CREATE TABLE IF statement | |
$_create_table_keys | boolean | Whether table keys are created from within the CREATE TABLE statement. | |
$_default | string | DEFAULT value representation in CREATE/ALTER TABLE statements | |
$_drop_database | string | DROP DATABASE statement | |
$_drop_table_if | string | DROP TABLE IF EXISTS statement | |
$_null | string | NULL value representation in CREATE/ALTER TABLE statements | |
$_rename_table | string | RENAME TABLE statement | |
$_unsigned | boolean | array | UNSIGNED support | |
$db | object | Database object |
Method | Description | |
---|---|---|
__construct ( &$db ) : void | Class constructor | |
add_column ( string $table, array $field, string $_after = NULL ) : boolean | Column Add | |
add_field ( array $field ) : CI_DB_forge | Add Field | |
add_key ( string $key, boolean $primary = FALSE ) : CI_DB_forge | Add Key | |
create_database ( string $db_name ) : boolean | Create database | |
create_table ( string $table, boolean $if_not_exists = FALSE, array $attributes = [] ) : boolean | Create Table | |
drop_column ( string $table, string $column_name ) : boolean | Column Drop | |
drop_database ( string $db_name ) : boolean | Drop database | |
drop_table ( string $table_name, boolean $if_exists = FALSE ) : boolean | Drop Table | |
modify_column ( string $table, string $field ) : boolean | Column Modify | |
rename_table ( string $table_name, string $new_table_name ) : boolean | Rename Table |
Method | Description | |
---|---|---|
_alter_table ( string $alter_type, string $table, mixed $field ) : string | string[] | ALTER TABLE | |
_attr_auto_increment ( &$attributes, &$field ) : void | Field attribute AUTO_INCREMENT | |
_attr_default ( &$attributes, &$field ) : void | Field attribute DEFAULT | |
_attr_type ( &$attributes ) : void | Field attribute TYPE | |
_attr_unique ( &$attributes, &$field ) : void | Field attribute UNIQUE | |
_attr_unsigned ( &$attributes, &$field ) : void | Field attribute UNSIGNED | |
_create_table ( string $table, boolean $if_not_exists, array $attributes ) : mixed | Create Table | |
_create_table_attr ( array $attributes ) : string | CREATE TABLE attributes | |
_drop_table ( string $table, boolean $if_exists ) : string | Drop Table | |
_process_column ( array $field ) : string | Process column | |
_process_fields ( boolean $create_table = FALSE ) : array | Process fields | |
_process_indexes ( string $table ) : string | Process indexes | |
_process_primary_keys ( string $table ) : string | Process primary keys | |
_reset ( ) : void | Reset |
protected _attr_auto_increment ( &$attributes, &$field ) : void | ||
return | void |
protected _attr_default ( &$attributes, &$field ) : void | ||
return | void |
protected _attr_type ( &$attributes ) : void | ||
return | void |
protected _attr_unique ( &$attributes, &$field ) : void | ||
return | void |
protected _attr_unsigned ( &$attributes, &$field ) : void | ||
return | void |
protected _create_table_attr ( array $attributes ) : string | ||
$attributes | array | Associative array of table attributes |
return | string |
protected _process_column ( array $field ) : string | ||
$field | array | |
return | string |
protected _process_fields ( boolean $create_table = FALSE ) : array | ||
$create_table | boolean | |
return | array |
protected _process_indexes ( string $table ) : string | ||
$table | string | |
return | string |
protected _process_primary_keys ( string $table ) : string | ||
$table | string | Table name |
return | string |
public create_database ( string $db_name ) : boolean | ||
$db_name | string | |
return | boolean |
public drop_database ( string $db_name ) : boolean | ||
$db_name | string | |
return | boolean |
protected string $_create_database | ||
return | string |
protected string $_create_table | ||
return | string |
protected string $_create_table_if | ||
return | string |
protected bool $_create_table_keys | ||
return | boolean |
protected string $_default | ||
return | string |
protected string $_drop_database | ||
return | string |
protected string $_drop_table_if | ||
return | string |
protected string $_null | ||
return | string |
protected string $_rename_table | ||
return | string |