最近我将数据库表的一列更改为另一列。在我执行迁移原则后:
$this->getRoute()->getObject()
我返回了一个错误:
“SQLSTATE [42S22]:找不到列:‘字段列表’中的 1054 列‘p.price_discount’未知”
如果我:
ProductTable::getInstance()->find(1);
一切正常!
我清空了 1000 次缓存并构建了 - 所有这些。
我的 schema.yml:
Product:
tableName: products
actAs:
Timestampable:
created:
name: created_at
type: timestamp
form: d-m-Y H:i:s
I18n:
fields: [title, subtitle, description, datasheet, returns_shippings, inspiration, use_care]
actAs:
Sluggable: { fields: [title], uniqueBy: [lang, title] }
columns:
id:
type: integer(4)
primary: true
notnull: true
autoincrement: true
ref:
type: string(45)
unique: true
notnull: true
active:
type: boolean
notnull: true
default: 0
new:
type: boolean
notnull: true
default: 0
title:
type: string(45)
subtitle:
type: string(45)
inspiration: clob
use_care: clob
brand:
type: string(45)
description:
type: clob(65535)
datasheet:
type: clob(65535)
returns_shippings:
type: clob(65535)
price:
type: float
notnull: true
default: 0
votes:
type: integer
notnull: true
default: 0
weight:
type: float
notnull: true
default: 0
iva_id:
type: integer(4)
notnull: true
relations:
Iva:
class: Iva
local: iva_id
foreign: id
foreignAlias: Products
Styles:
foreignAlias: Products
class: Style
refClass: StyleProduct
onDelete: CASCADE
Categories:
foreignAlias: Products
class: Category
refClass: CategoryProduct
onDelete: CASCADE
RelatedProducts:
foreignAlias: Products
class: Product
refClass: RelatedProduct
local: product_id
foreign: product_id1
onDelete: CASCADE
怎么了?