Magento Multi Database Guide
Handy link to a very useful PDF which details how to handle multiple databases in Magento.
Related cards:
Magento Version History
Here is a table showing major changes over the Magento version history:
| CE | PE | EE | Year | Major Changes ...
Table Creation In Magento 1.6/1.11+
Magento CE 1.6 and PE/EE 1.11 introduced database abstraction, this is the way to set up tables using the new code.
$table = $installer->getConnection()
->newTable($installer->getTable('your_module/table_name_in_xml'))
->...
Database Schema
This site shows details of the Magento database schema for differing versions - it shows foreign key relationships in a nice drag-and-drop interface
Magento Model Diagram
This is a high-level view of the Magento Model, Resource Model and Resource Collection Model structure
Removing Custom Attributes Across Multiple Products
If you have custom attributes named the same across multiple products, you
wish to remove said attributes, this might come in useful. The SQL below restricts
the removal of the attributes to a certain attribute set name, but you can remove
this is...
Enabling MySQL Query Logging
In /lib/Varien/Db/Adapter/Pdo/Mysql.php change this property to true:
/**
* Write SQL debug data to file
*
* @var bool
*/
protected $_debug = false;
To enable logging for queries slower than a certain ti...
Getting A Database Adapter (Read or Write)
To read:
Mage::getSingleton('core/resource')->getConnection('core_read');
To write:
Mage::getSingleton('core/resource')->getConnection('core_write');
Remove Customers From MySQL
Is this ok?
TRUNCATE TABLE `customer_address_entity`;
TRUNCATE TABLE `customer_address_entity_datetime`;
TRUNCATE TABLE `customer_address_entity_decimal`;
TRUNCATE TABLE `customer_address_entity_int`;
TRUNCATE TABLE `customer_...
Remove Orders From MySQL
What version did flat come in? Are all these tables safe to truncate? Make different scripts for different versions.
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
...