我正在尝试向 magento 添加两个表,但它仍然不起作用!我没有得到 MySQL 中的表。没有错误消息,只是没有任何反应。我找不到错误在哪里;我已经检查了我所有的页面。
这是我在 config.xml 中的 XML 代码:
<models>
<interactivebanner>
<class>Kiwi_InteractiveBanner_Model</class>
<resourceModel>InteractiveBanner_resource</resourceModel>
</interactivebanner>
<interactivebanner_resource>
<class>Kiwi_InteractiveBanner_Model_Resource</class>
<entities>
<interactivebanner>
<table>interactivebanner</table>
</interactivebanner>
<interactivebanner2>
<table>interactivebanner_prod</table>
</interactivebanner2>
</entities>
</interactivebanner_resource>
</models>
这是设置页面:
<?php
$installer = $this;
$installer->startSetup();
$installer->run("
DROP TABLE IF EXISTS `{$this->getTable('interactivebanner/interactivebanner')}`;
create table `{$this->getTable('interactivebanner/interactivebanner')}`
(
ENTITY_ID int not null,
NAME varchar(100),
LINK varchar(100),
STATUS int,
primary key (ENTITY_ID)
);
DROP TABLE IF EXISTS `{$this->getTable('interactivebanner/interactivebanner_prod')}`;
create table `{$this->getTable('interactivebanner/interactivebanner_prod')}`
(
PROD_ID int not null,
ENTITY_ID int,
POSI_V float,
POSI_H float,
primary key (PROD_ID)
);
alter table banner_pro add constraint FK_RELATION_1 foreign key (ENTITY_ID)
references banner (ENTITY_ID) on delete restrict on update restrict;
");
$installer->endSetup();