table('extension_eav_attribute', ['engine' => 'InnoDB', 'charset' => 'utf8mb4', 'comment' => '属性定义表']) ->addColumn('entity_type_id', 'integer', ['signed' => false, 'comment' => '关联实体类型']) ->addColumn('attribute_code', 'string', ['comment' => '属性编码', 'limit' => 64]) ->addColumn('backend_type', 'string', ['comment' => '存储类型(int/varchar/decimal/text), 需与frontend_input匹配', 'limit' => 8]) ->addColumn('frontend_input', 'string', ['comment' => '表单控件类型', 'limit' => 16]) ->addColumn('frontend_label', 'string', ['comment' => '显示标签', 'limit' => 255]) ->addColumn('is_required', 'boolean', ['comment' => '是否必填', 'default' => false]) ->addIndex(['entity_type_id', 'attribute_code'], ['unique' => true]) ->addTimestamps('create_time', 'update_time') ->addColumn('delete_time', 'timestamp', ['null' => true, 'comment' => '删除时间']) ->create(); } }