1.20.x config_database_storage.inc | public ConfigDatabaseStorage::initializeStorage() |
Create the database table it does not already exist.
Return value
bool: TRUE on success, FALSE in case of an error.
Throws
Overrides ConfigStorageInterface::initializeStorage
File
- drivers/
config_database/ config_database_storage.inc, line 110
Class
- ConfigDatabaseStorage
- Defines the database storage controller.
Code
public function initializeStorage() {
if (!db_table_exists($this->table, array('target' => $this->database))) {
try {
db_create_table($this->table, $this->schema($this->table));
}
catch (\Exception $e) {
throw new ConfigStorageException(format_string('The database table %table could not be created: @error', array(
'%table' => $config_directory,
'@error' => $e->getMessage(),
)), 0, $e);
}
}
return TRUE;
}