diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-05-06 11:23:37 +0200 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-05-06 12:19:22 +0200 |
| commit | 89917dd624bb1e2d56e142e114125a4342e7c2c9 (patch) | |
| tree | f28adcfcb194cb50e9de4896cbe3d7ae985f7845 /lib | |
| parent | 550423457789d0d2a52580b673571566dc38a77c (diff) | |
fix migration 5.3.30 for different stud.ip version, fixes #5569
Closes #5569
Merge request studip/studip!4192
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/migrations/DatabaseMigrationTrait.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/migrations/DatabaseMigrationTrait.php b/lib/migrations/DatabaseMigrationTrait.php index f8fad72..ab6bf05 100644 --- a/lib/migrations/DatabaseMigrationTrait.php +++ b/lib/migrations/DatabaseMigrationTrait.php @@ -19,4 +19,13 @@ trait DatabaseMigrationTrait $query = "SHOW COLUMNS FROM `{$table}` LIKE ?"; return (bool) DBManager::get()->fetchOne($query, [$column]); } + + /** + * Returns whether a table with the given name exists. + */ + protected function tableExists(string $table): bool + { + $query = "SHOW TABLES LIKE ?"; + return (bool) DBManager::get()->fetchOne($query, [$table]); + } } |
