diff --git a/application/migrations/052_add_price_column_to_appointments_table.php b/application/migrations/052_add_price_column_to_appointments_table.php index d13e8718..a673a7ab 100644 --- a/application/migrations/052_add_price_column_to_appointments_table.php +++ b/application/migrations/052_add_price_column_to_appointments_table.php @@ -36,10 +36,11 @@ class Migration_Add_price_column_to_appointments_table extends EA_Migration $this->dbforge->add_column('appointments', $fields); // Update existing records - $sql = "UPDATE `appointments` - JOIN `services` ON `appointments`.`id_services` = `services`.`id` + $sql = "UPDATE `" . $this->db->dbprefix('appointments') . "` AS `appointments` + JOIN `" . $this->db->dbprefix('services') . "` AS `services` ON `appointments`.`id_services` = `services`.`id` SET `appointments`.`price` = `services`.`price`, `appointments`.`currency` = `services`.`currency`"; + $this->db->query($sql); }