Reply To: Change currency symbol site wide

#464
RRowley
Participant

The error for patch #318 foreign keys needs to be resolved. Any more information on this? The following are the commands that comprise this patch. Try applying them one at a time in the given order and see where it fails.

ALTER TABLE si_cron ADD FOREIGN KEY (invoice_id) REFERENCES si_invoices (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_cron_log ADD FOREIGN KEY (cron_id) REFERENCES si_cron (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_expense ADD FOREIGN KEY (biller_id) REFERENCES si_biller (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_expense ADD FOREIGN KEY (customer_id) REFERENCES si_customers (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_expense ADD FOREIGN KEY (invoice_id) REFERENCES si_invoices (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_expense ADD FOREIGN KEY (product_id) REFERENCES si_products (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_expense ADD FOREIGN KEY (expense_account_id) REFERENCES si_expense_account (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_expense_item_tax ADD FOREIGN KEY (expense_id) REFERENCES si_expense (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_expense_item_tax ADD FOREIGN KEY (tax_id) REFERENCES si_tax (tax_id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_inventory ADD FOREIGN KEY (product_id) REFERENCES si_products (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_invoices ADD FOREIGN KEY (biller_id) REFERENCES si_biller (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_invoices ADD FOREIGN KEY (customer_id) REFERENCES si_customers (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_invoices ADD FOREIGN KEY (type_id) REFERENCES si_invoice_type (inv_ty_id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_invoices ADD FOREIGN KEY (preference_id) REFERENCES si_preferences (pref_id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_invoice_items ADD FOREIGN KEY (invoice_id) REFERENCES si_invoices (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_invoice_items ADD FOREIGN KEY (product_id) REFERENCES si_products (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_invoice_item_tax ADD FOREIGN KEY (tax_id) REFERENCES si_tax (tax_id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_invoice_item_attachments ADD FOREIGN KEY (invoice_item_id) REFERENCES si_invoice_items (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_log ADD FOREIGN KEY (user_id) REFERENCES si_user (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_payment ADD FOREIGN KEY (ac_inv_id) REFERENCES si_invoices (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_payment ADD FOREIGN KEY (ac_payment_type) REFERENCES si_payment_types (pt_id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_products ADD FOREIGN KEY (default_tax_id) REFERENCES si_tax (tax_id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_products ADD FOREIGN KEY (default_tax_id_2) REFERENCES si_tax (tax_id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_products_attributes ADD FOREIGN KEY (type_id) REFERENCES si_products_attribute_type (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_products_values ADD FOREIGN KEY (attribute_id) REFERENCES si_products_attributes (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_user ADD FOREIGN KEY (domain_id) REFERENCES si_user_domain (id) ON UPDATE CASCADE ON DELETE RESTRICT;
ALTER TABLE si_user ADD FOREIGN KEY (role_id) REFERENCES si_user_role (id) ON UPDATE CASCADE ON DELETE RESTRICT;