Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6684765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:58:41+00:00 2026-05-26T04:58:41+00:00

I dropped a table manually in magento. Now I want my code to recreate

  • 0

I dropped a table manually in magento. Now I want my code to recreate the same table.. I Have written the create statement in app/code/local/namespace/my_module/sql folder like this

DROP TABLE IF EXISTS {$this->getTable('cod')};
CREATE TABLE {$this->getTable('cod')} (
    `cod_id` int(11) unsigned NOT NULL auto_increment,
    `status` smallint(6) NOT NULL default '0',
    'amount' int(11) unsigned NOT NULL,
    `created_time` datetime NULL,
    `update_time` datetime NULL,
    PRIMARY KEY (`cod_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

How will this query execute so that it can recreate the table…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:58:41+00:00Added an answer on May 26, 2026 at 4:58 am

    This query is executed when you run magento with your module first time. After this magento adds row to core_resource table my_module_setup | 0.01 | 0.01
    which means, your module was set up successfully.
    So, to recreate table you should drop row my_module_setup from core_resource table and run any magento page again.
    Please note, version & data_version columns let you hold module’s version up to date. If you change module’s version in config.xml to higher than it is in core_resource, magento will look for mysql4-upgrade-0.1.0-0.1.1.php.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with a varbinary(max) column for an image. I have dropped
In the L2S designer I have dropped a table and a view. I tried
I have an Access database in which I drop the table and then create
I have a table. When the item is dropped I need to apply padding
I have a table of Products and one of ProductGroups to categorize them. Now
I am trying to create a table that was dropped previously. But when I
I have a list of draggable table cells that can be dropped onto a
I've accidentally dropped a database inside my server . I have no backup of
I have to restore a database that has been inadvertently DROPped in MySQL 5.0.
i have a small program where an element is draged and dropped, when the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.