Handle Versioned implementations that do not have stages

This commit is contained in:
Robbie Averill 2017-01-13 11:29:48 +13:00
parent 2d1d2aea79
commit 9559cb2eda

View File

@ -331,8 +331,11 @@ class DatabaseAdmin extends Controller
$updateQueries = [sprintf($updateQuery, '')];
// Remap versioned table ClassName values as well
if (singleton($newClassName)->has_extension(Versioned::class)) {
$updateQueries[] = sprintf($updateQuery, '_Live');
$class = singleton($newClassName);
if ($class->has_extension(Versioned::class)) {
if ($class->hasStages()) {
$updateQueries[] = sprintf($updateQuery, '_Live');
}
$updateQueries[] = sprintf($updateQuery, '_Versions');
}