0

After Install Magento I can see TABLE in database like:

admin_assert
admin_role
admin_rule
admin_user

For example, I has new CREATE TABLE as listed below, how could I point Magento to READ this new TABLES and leave the old one.

myshopadmin_assert
myshopadmin_role
myshopadmin_rule
myshopadmin_user

note: all tables I create with new name, that means i have 2 same table with different name, and old table with no data table.

Thanks in advance.

  • Do you want all tables to have this new naming structure? If so why not use the prefix when creating the database? – David Manners Jan 25 '14 at 9:16
  • Can you explain what your intentions are? As @DavidManners already asked, is this all tables, or just the ones you mention, and frankly if the later, why? (I cannot fathom that) – ProxiBlue Jan 25 '14 at 12:39
2

Magento links Resource classes with tables through config.xml. For example for admin tables app\code\core\Mage\Admin\etc\config.xml

    <models>
        <admin>
            <class>Mage_Admin_Model</class>
            <resourceModel>admin_resource</resourceModel>
        </admin>
        <admin_resource>
            <class>Mage_Admin_Model_Resource</class>
            <deprecatedNode>admin_mysql4</deprecatedNode>
            <entities>
                <user>
                    <table>admin_user</table>
                </user>
                <role>
                    <table>admin_role</table>
                </role>
                <rule>
                    <table>admin_rule</table>
                </rule>
                <assert>
                    <table>admin_assert</table>
                </assert>
            </entities>
        </admin_resource>
    </models>

So you can easily write your own extension and rewrite these tables names. In case tables have the same structure you should reach the result you want.

But the disadvantage of this way is that you will have problems with upgrading your magento to newest version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy