<?php
/**
 * 更新数据结构
 */
$prefix = \Phpcmf\Service::M()->prefix;
$table = $prefix.'weixin_content';
$t = \Phpcmf\Service::M('table');
$m = \Phpcmf\Service::M();

if ($m->is_table_exists($table)) {
    if (!$m->is_field_exists($table, 'nums')) {
        $t->add_field($table, 'nums', 'tinyint(2)', 'DEFAULT \'0\'', '');
    }
    if (!$m->is_field_exists($table, 'status')) {
        $t->add_field($table, 'status', 'tinyint(2)', 'DEFAULT \'0\'', '');
    }
    if (!$m->is_field_exists($table, 'publish_id')) {
        $t->add_field($table, 'publish_id', 'varchar(255)', 'DEFAULT \'\'', '');
    }
    if (!$m->is_field_exists($table, 'article_id')) {
        $t->add_field($table, 'article_id', 'varchar(255)', 'DEFAULT \'\'', '');
    }
}
