在编写代码初始化器迁移时,我不确定如何添加十进制类型的字段。具体来说,如何定义允许的元素大小?例如,我将如何定义要传递给dbforge->add_field()
的数组以创建类似于以下内容的字段:
price decimal(10,2) not null default 0.00
最佳答案
'price' => array(
'type' => 'DECIMAL',
'constraint' => '10,2',
),
关于codeigniter - 如何在Codeigniter迁移文件中添加小数字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10143120/