Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Skip column change diff changes for new tables

givanzca4dfca61967
diff --git a/system/update.php b/system/update.php
index 8cfdb6a..4599b69 100755
--- a/system/update.php
+++ b/system/update.php
@@ -259,6 +259,7 @@ class Update {
$columns = preg_split('/\r\n|\r|\n/', trim($matches[2]));
foreach ($columns as $key => &$column) {
+ $column = preg_replace('/-- .+$/', '', $column); //remove comments
$column = trim($column, ' ,');
if ($column && in_array($column[0], ['`', '"', '\''])) {
@@ -309,6 +310,11 @@ class Update {
//newly added columns
$tableColumns = $db->getColumnsMeta($tableName);
+ //if table does not exist yet skip, it will be created
+ if (! $tableColumns) {
+ continue;
+ }
+
$addedColumns = array_diff_key($newColumns, $tableColumns);
//changed columns