我有一个模型位于我的模块的类文件夹中:
public static $definition = array(
'table' => 'myTable',
'primary' => 'id',
'multilang' => false,
'fields' => array(
'day' => array('type' => self::TYPE_INT, 'required' => true),
'hours' => array('type' => self::TYPE_STRING, 'required' => false),
'active' => array('type' => self::TYPE_BOOL, 'required' => false),
),
);
我想添加一个字段 category_id ,我这样做了:
public static $definition = array(
'table' => 'MyTable',
'primary' => 'id',
'multilang' => false,
'fields' => array(
'day' => array('type' => self::TYPE_INT, 'required' => true),
'hours' => array('type' => self::TYPE_STRING, 'required' => false),
'active' => array('type' => self::TYPE_BOOL, 'required' => false),
'category_id' => array('type' => self::TYPE_INT, 'required' => true)
),
);
但是当我创建时new MyTable
,我没有看到新字段,我认为这是一个缓存问题,但我不知道如何解决它。