我在newsletter_subscriber表中添加了一个新列'artists_followed'。在我覆盖的Mage_Newsletter_Model_Subscriber
模型类中,添加了以下功能:
public function updateSubscriberArtists($email, $artist) {
$this->loadByEmail($email);
if ($this->getId()) {
$this->setArtistsFollowed($artist);
try {
$this->save();
}
catch (Exception $e) {
throw new Exception($e->getMessage());
}
}
}
一切正常,没有错误,但是当我查看数据库时,不会填充新列。
我的桌子是:
CREATE TABLE `mage_newsletter_subscriber` (
`subscriber_id` int(7) unsigned NOT NULL AUTO_INCREMENT,
`store_id` smallint(5) unsigned DEFAULT '0',
`change_status_at` datetime DEFAULT NULL,
`customer_id` int(11) unsigned NOT NULL DEFAULT '0',
`subscriber_email` varchar(150) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT '',
`subscriber_status` int(3) NOT NULL DEFAULT '0',
`subscriber_confirm_code` varchar(32) DEFAULT 'NULL',
`created_at` datetime DEFAULT NULL,
`campaign_source` varchar(255) DEFAULT NULL,
`artists_followed` text,
PRIMARY KEY (`subscriber_id`),
KEY `FK_SUBSCRIBER_CUSTOMER` (`customer_id`),
KEY `FK_NEWSLETTER_SUBSCRIBER_STORE` (`store_id`),
CONSTRAINT `FK_NEWSLETTER_SUBSCRIBER_STORE` FOREIGN KEY (`store_id`) REFERENCES `mage_core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter subscribers';
我正在为此绞尽脑汁。有任何想法吗?我错过了完全显而易见的东西吗?
我有同样的问题。尽管模型已正确设置了该字段,但在SalesRule中添加了一个属性(列),但从未更新数据库。
—
Vicary 2014年
如果有人使用n98-magerun,这可能会有所帮助:
—
Attila Naghi
./n98-magerun cache:flush
:)