<?php

/**
 * 更新数据结构
 **/

$m = \Phpcmf\Service::M();
$t = \Phpcmf\Service::M('table');
$prefix = $m->prefix;

foreach ($this->site as $siteid) {
    $table = $prefix.$siteid.'_block';
    if ($m->is_table_exists($table) && !$m->is_field_exists($table, 'code')) {
        $t->add_field($table, 'code', 'VARCHAR(100)', 'NOT NULL', '');
    }
}
