Fixes in padmin

This commit is contained in:
Antonio de la Rosa 2016-02-11 01:41:20 +01:00
parent 0fcccb2553
commit 6e12c3eea3

View file

@ -241,9 +241,15 @@ function update_table()
unset($allfields[$field]); unset($allfields[$field]);
if(Webmodel::$model[$key]->components[$field]->get_type_sql()!=($type.' '.$null_set[$field].' DEFAULT "'.$defaults[$field].'"')) //Delete default
$type_sql=preg_replace('/^(.*) DEFAULT.*$/', '$1', Webmodel::$model[$key]->components[$field]->get_type_sql());
if($type_sql!=($type.' '.$null_set[$field]))
{ {
//echo $type_sql.'='.($type.' '.$null_set[$field])."\n";
$query=SQLClass::webtsys_query('alter table `'.$key.'` modify `'.$field.'` '.Webmodel::$model[$key]->components[$field]->get_type_sql()); $query=SQLClass::webtsys_query('alter table `'.$key.'` modify `'.$field.'` '.Webmodel::$model[$key]->components[$field]->get_type_sql());
echo "Upgrading ".$field." from ".$key."...\n"; echo "Upgrading ".$field." from ".$key."...\n";