Function DatabaseConnector->create_table
Definitions
sources/database.php
- Create a table with the given name and the given array of field name to type mappings.If a field type starts '*', then it is part of that field's key. If it starts '?', then it is an optional field.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
Parameters
Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
---|---|---|---|---|---|---|---|
$table_name | ID_TEXT | No | No | required parameter | N/A | N/A | The table name |
$fields | array | No | No | required parameter | N/A | N/A | The fields |
$skip_size_check | boolean | No | No | False | N/A | N/A | Whether to skip the size check for the table (only do this for addon modules that don't need to support anything other than MySQL) |
$skip_null_check | boolean | No | No | False | N/A | N/A | Whether to skip the check for null string fields |
$save_bytes | ?boolean | No | No | False | N/A | N/A | Whether to use lower-byte table storage, with trade-offs of not being able to support all unicode characters; use this if key length is an issue (null: autodetect) |
$skip_fulltext_key_check | boolean | No | No | False | N/A | N/A | Whether to skip checking if keys are appropriate for any auto-created fulltext indices |
Preview
Code (PHP)
/**
* Create a table with the given name and the given array of field name to type mappings.If a field type starts '*', then it is part of that field's key. If it starts '?', then it is an optional field.
*
* @param ID_TEXT $table_name The table name
* @param array $fields The fields
* @param boolean $skip_size_check Whether to skip the size check for the table (only do this for addon modules that don't need to support anything other than MySQL)
* @param boolean $skip_null_check Whether to skip the check for null string fields
* @param ?boolean $save_bytes Whether to use lower-byte table storage, with trade-offs of not being able to support all unicode characters; use this if key length is an issue (null: autodetect)
* @param boolean $skip_fulltext_key_check Whether to skip checking if keys are appropriate for any auto-created fulltext indices
*/
public function create_table(string $table_name, array $fields, bool $skip_size_check = false, bool $skip_null_check = false, ?bool $save_bytes = false, bool $skip_fulltext_key_check = false)
* Create a table with the given name and the given array of field name to type mappings.If a field type starts '*', then it is part of that field's key. If it starts '?', then it is an optional field.
*
* @param ID_TEXT $table_name The table name
* @param array $fields The fields
* @param boolean $skip_size_check Whether to skip the size check for the table (only do this for addon modules that don't need to support anything other than MySQL)
* @param boolean $skip_null_check Whether to skip the check for null string fields
* @param ?boolean $save_bytes Whether to use lower-byte table storage, with trade-offs of not being able to support all unicode characters; use this if key length is an issue (null: autodetect)
* @param boolean $skip_fulltext_key_check Whether to skip checking if keys are appropriate for any auto-created fulltext indices
*/
public function create_table(string $table_name, array $fields, bool $skip_size_check = false, bool $skip_null_check = false, ?bool $save_bytes = false, bool $skip_fulltext_key_check = false)