table('extension_eav_value', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '扩展:EAV值表']); $table ->addColumn('entity_id', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '实体ID']) ->addColumn('attribute_id', 'integer', ['signed' => false, 'limit' => 11, 'default' => 0, 'comment' => '属性ID']) ->addColumn('entity_type_id', 'integer', ['signed' => false, 'default' => 0, 'comment' => '实体类型ID']) ->addColumn('value_int', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '整数值']) ->addColumn('value_varchar', 'string', ['limit' => 255, 'default' => '', 'comment' => '字符串值']) ->addColumn('value_decimal', 'decimal', ['precision' => 10, 'scale' => 2, 'default' => 0.00, 'comment' => '数值值']) ->addColumn('value_text', 'text', ['comment' => '文本值']) ->addColumn('value_datetime', 'datetime', ['comment' => '日期时间值']) ->addIndex(['entity_id', 'attribute_id'], ['name' => 'entity_id_attribute_id']) ->addIndex(['entity_id', 'entity_type_id'],['name' => 'idx_entity_id_entity_type_id']) ->addTimestamps() ->addSoftDelete() ->create(); } }