1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-20 23:41:29 +02:00

Merge pull request #6564 from marc1706/ticket/13162

[ticket/13162] Add truncate table functionality to database tools
This commit is contained in:
Marc Alexander
2024-02-23 19:57:49 +01:00
committed by GitHub
22 changed files with 144 additions and 113 deletions

View File

@@ -363,6 +363,21 @@ class doctrine implements tools_interface
);
}
/**
* {@inheritDoc}
*/
public function sql_truncate_table(string $table_name): void
{
try
{
$this->connection->executeQuery($this->get_schema_manager()->getDatabasePlatform()->getTruncateTableSQL($table_name));
}
catch (Exception $e)
{
return;
}
}
/**
* Returns an array of indices for either unique and primary keys, or simple indices.
*

View File

@@ -207,4 +207,12 @@ interface tools_interface
* @return bool|string[] True if the statements have been executed
*/
public function sql_create_primary_key(string $table_name, $column);
/**
* Truncate the table
*
* @param string $table_name
* @return void
*/
public function sql_truncate_table(string $table_name): void;
}