mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-13 11:28:26 -04:00
Allow ON DELETE CASCADE for receiving_id foreign key in links table
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Migration_modify_attr_links_constraint extends CI_Migration
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
error_log('Migrating modify_attr_links_constraint');
|
||||
|
||||
|
||||
execute_script(APPPATH . 'migrations/sqlscripts/3.3.2_modify_attr_links_constraint.sql');
|
||||
|
||||
error_log('Migrating modify_attr_links_constraint');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,8 @@
|
||||
ALTER TABLE `ospos_attribute_links`
|
||||
DROP FOREIGN KEY `ospos_attribute_links_ibfk_4`;
|
||||
|
||||
ALTER TABLE `ospos_attribute_links`
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_4`
|
||||
FOREIGN KEY (`receiving_id`) REFERENCES `ospos_receivings`(`receiving_id`)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE RESTRICT;
|
||||
Reference in New Issue
Block a user