1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-05 16:27:38 +02:00

Merge pull request #2288 from nickvergessen/ticket/12012

[ticket/12012] Correctly drop default value constraints

* nickvergessen/ticket/12012:
  [ticket/12012] Move property to the top
  [ticket/12012] Move MS SQL server comparison into a method
  [ticket/12012] Fix docs in connection manager
  [ticket/12012] Remove duplicated code (only the $sql are different)
  [ticket/12012] Handle begin and commit transactions in tests
  [ticket/12012] Drop and recreate indexes when removing columns
  [ticket/12012] Add a unit test for removing a column with indexes
  [ticket/12012] Add a unit test for changing the column type
  [ticket/12012] Return SQL statements for index drop/create
  [ticket/12012] Fix tools::mssql_get_existing_indexes() for SQL Server 2000
  [ticket/12012] Drop and recreate indexes when changing a column on MSSQL
  [ticket/12012] Fix query layout
  [ticket/12012] Correctly drop default value constraints on MSSQL
This commit is contained in:
Andreas Fischer
2014-04-25 18:54:40 +02:00
3 changed files with 294 additions and 79 deletions

View File

@@ -12,8 +12,11 @@ require_once dirname(__FILE__) . '/phpbb_database_connection_odbc_pdo_wrapper.ph
class phpbb_database_test_connection_manager
{
/** @var array */
private $config;
/** @var array */
private $dbms;
/** @var \PDO */
private $pdo;
/**
@@ -363,9 +366,21 @@ class phpbb_database_test_connection_manager
$table_name,
$table_data
);
foreach ($queries as $query)
{
$this->pdo->exec($query);
if ($query === 'begin')
{
$this->pdo->beginTransaction();
}
else if ($query === 'commit')
{
$this->pdo->commit();
}
else
{
$this->pdo->exec($query);
}
}
}
}