I am trying to update the existing newsletter_subscriber
table by adding 2 more additional columns, and updating the grid view within the Adminhtml by adding those 2 new columns and removing the middle name
, website
, etc.
Step 1: I successfully updated the front-end portion to include the required information in a phtml
pop up and validating the fields.
Below are the basics of what I started for updating the database and moving towards the backend of my tasks, but seem to be getting nowhere. I have books and have been combing through Magento resources, to no avail other than feeling more perplexed.
My config.xml
I have tried adding a class within the setup tags
(<class>Mage_Newsletter_Model_Resource_Subscriber_Collection</class>)
but I end up with a
Fatal error: Call to a member function getReadConnection() on string in...Mage/Core/Model/Resource/Db/Collection/Abstract.php on line 134:
<?xml version="1.0"?>
<config>
<modules>
<CollegePark_Newsletter>
<version>1.0.0</version>
</CollegePark_Newsletter>
</modules>
<global>
<resources>
<cp_newsletter_setup>
<setup>
<module>CollegePark_Newsletter</module>
</setup>
</cp_newsletter_setup>
</resources>
</global>
</config>
app/etc/modules/CollegePark_Newsletter.xml:
<?xml version="1.0"?>
<config>
<modules>
<CollegePark_Newsletter>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Newsletter />
</depends>
</CollegePark_Newsletter>
</modules>
</config>
And last my CollegePark/Newsletter/sql/cp_newsletter_setup/install-1.0.0.php:
<?php
/**
* Upgrade script to add columns:
*
*/
/* @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
$installer->getConnection()
->addColumn(
$installer->getTable('newsletter/subscriber'),
'subscriber_facility',
[
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'nullable' => true,
'comment' => 'Facility'
]
);
$installer->getConnection()
->addColumn(
$installer->getTable('newsletter/subscriber'),
'subscriber_zip',
[
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'nullable' => true,
'comment' => 'Zip/Postal Code'
]
);
$installer->endSetup();
So to all you gurus out there, what am I doing wrong???