From e00d344ba8a01f2b1d7d1e01abd2f1d44b91ede1 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 29 Sep 2019 19:16:22 +0200 Subject: [PATCH] Add PartialDatabaseTable Close #3081 --- .../table/DatabaseTableChangeProcessor.class.php | 4 ++++ .../database/table/PartialDatabaseTable.class.php | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 wcfsetup/install/files/lib/system/database/table/PartialDatabaseTable.class.php diff --git a/wcfsetup/install/files/lib/system/database/table/DatabaseTableChangeProcessor.class.php b/wcfsetup/install/files/lib/system/database/table/DatabaseTableChangeProcessor.class.php index 3672aba3c4..6a0edd586f 100644 --- a/wcfsetup/install/files/lib/system/database/table/DatabaseTableChangeProcessor.class.php +++ b/wcfsetup/install/files/lib/system/database/table/DatabaseTableChangeProcessor.class.php @@ -373,6 +373,10 @@ class DatabaseTableChangeProcessor { } } else if (!in_array($tableName, $this->existingTableNames)) { + if ($table instanceof PartialDatabaseTable) { + throw new \LogicException("Partial table '{$tableName}' cannot be created."); + } + $this->tablesToCreate[] = $table; $this->splitNodeMessage .= "Created table '{$tableName}'."; diff --git a/wcfsetup/install/files/lib/system/database/table/PartialDatabaseTable.class.php b/wcfsetup/install/files/lib/system/database/table/PartialDatabaseTable.class.php new file mode 100644 index 0000000000..3430d18cc7 --- /dev/null +++ b/wcfsetup/install/files/lib/system/database/table/PartialDatabaseTable.class.php @@ -0,0 +1,15 @@ + + * @package WoltLabSuite\Core\System\Database\Table + * @since 5.2 + */ +class PartialDatabaseTable extends DatabaseTable {} -- 2.20.1