Answer the question
In order to leave comments, you need to log in
Table not being created in database with Magento installer file?
config.xml
<?xml version="1.0" ?>
<config>
<modules>
<My_Articles>
<version>1.0.0</version>
</My_Articles>
</modules>
<frontend>
<routers>
<marticles>
<use>standard</use>
<args>
<module>My_Articles</module>
<frontName>articles</frontName>
</args>
</marticles>
</routers>
</frontend>
<global>
<myarticles_recource>
<class>My_Articles_Model_Resource</class>
<entities>
<table_myarticles>
<table>my_articles</table>
</table_myarticles>
</entities>
</myarticles_recource>
</global>
</config>
<?php
die('Setup');
$installer = $this;
$installer->startSetup();
$installer->run("CREATE TABLE my_articles (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` VARCHAR(255) NOT NULL,
`header_h1` VARCHAR(255) NOT NULL,
`meta_tag_keywords` VARCHAR(255) NOT NULL,
`meta_tag_description` VARCHAR(255) NOT NULL,
`image` VARCHAR(255) NOT NULL,
`preview` TEXT NOT NULL,
`content` TEXT NOT NULL,
`created` DATETIME,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
$installer->endSetup();
Answer the question
In order to leave comments, you need to log in
Because the Global section does not indicate that you are going to install something.
You need to add something like this to the Global section
<resources>
<myarticles_setup>
<setup>
<module>My_Articles</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</myarticles_setup>
<myarticles_write>
<connection>
<use>core_write</use>
</connection>
</myarticles_write>
<myarticles_read>
<connection>
<use>core_read</use>
</connection>
</myarticles_read>
</resources>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question