1

I'm quite new to magento development and could not find any information on this theme.

I know that the catalog_product_flat* tables are indexed and are only existing, if magento is set to use flat tables. Therefore data stored here might get deleted and the tables could get recreated with data from other tables.

Is the same true for the sales_flat* tables? I'm writing a module and I'm storing data in these tables. If they could get dropped and then reconstructed by magento i would loose this data. Is it safe to store data only in these tables? Or should i use other tables and then populate the data in sales_flat* with these?

For example i would like to store the payment date if an invoice in sales_flat_invoice and sales_flat_invoice_grid. Because the german tax office needs these dates instead of the date the invoice was issued.

1

The sales_flat_* tables do not follow the same rules as the catalog_flat_* tables.
They are here to stay. Those are the actual tables that hold the order (and onthers) informations.
The name flat was added in Magento CE 1.4 when the orders became flat entities. At first they were EAV and the table name was sales_order. but in order to migrate from EAV to flat there was a need for an other table name. I guess they added flat because it was the logical thing to do.
In conclusion, you can add data to those tables. They wont get recreated.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.