1

I have created one custom module, now I need to alter some fields into the table sales_flat_order and sales_flat_order_item , I have used following alter queries:

ALTER TABLE `sales_flat_order_item` ADD COLUMN `sweet_tooth_label` VARCHAR( 60 ) 
ALTER TABLE sales_flat_order ADD COLUMN `sweet_tooth_label` VARCHAR( 60 ) 

but it won't work for me. Please suggest me any best solution.

  • have you any table prefix – Amit Bera Mar 19 '15 at 10:56
  • No I want to add custom fields to core tables i.e. sales_flat_order – swash_nam Mar 19 '15 at 11:07
  • check table is in innodb or myasm – Amit Bera Mar 19 '15 at 11:07
  • 1
    SQL syntax is correct but try ALTER TABLE test` ADD sweet_tooth_label VARCHAR(60)` as well. Include the error message in your post. Run the query directly, and it will give you an error, if it didn't work. – musicliftsme Mar 19 '15 at 14:02
  • Yes, error message would be great. Also - if it's a custom module, please use an installer. It is extremely bad practise to use direct SQL statements in magento imho – simonthesorcerer Mar 24 '15 at 22:50

Your Answer

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

Browse other questions tagged or ask your own question.