mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-07 15:23:50 -04:00
Add missing database constraints.
This commit is contained in:
20
application/migrations/20190612100000_dbfix.php
Normal file
20
application/migrations/20190612100000_dbfix.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Migration_DBFix extends CI_Migration
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
execute_script(APPPATH . 'migrations/sqlscripts/3.3.0_dbfix.sql');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
30
application/migrations/sqlscripts/3.3.0_dbfix.sql
Normal file
30
application/migrations/sqlscripts/3.3.0_dbfix.sql
Normal file
@@ -0,0 +1,30 @@
|
||||
ALTER TABLE `ospos_sales_payments` ADD INDEX `employee_id` (`employee_id`);
|
||||
|
||||
ALTER TABLE `ospos_sales_payments`
|
||||
ADD CONSTRAINT `ospos_sales_payments_ibfk_2` FOREIGN KEY (`employee_id`) REFERENCES `ospos_employees` (`person_id`);
|
||||
|
||||
ALTER TABLE `ospos_customers` ADD INDEX `sales_tax_code_id` (`sales_tax_code_id`);
|
||||
|
||||
ALTER TABLE `ospos_customers`
|
||||
ADD CONSTRAINT `ospos_customers_ibfk_3` FOREIGN KEY (`sales_tax_code_id`) REFERENCES `ospos_tax_codes` (`tax_code_id`);
|
||||
|
||||
ALTER TABLE `ospos_tax_rates` ADD INDEX `rate_tax_category_id` (`rate_tax_category_id`);
|
||||
|
||||
ALTER TABLE `ospos_tax_rates`
|
||||
ADD CONSTRAINT `ospos_tax_rates_ibfk_1` FOREIGN KEY (`rate_tax_category_id`) REFERENCES `ospos_tax_categories` (`tax_category_id`);
|
||||
|
||||
ALTER TABLE `ospos_tax_rates` ADD INDEX `rate_tax_code_id` (`rate_tax_code_id`);
|
||||
|
||||
ALTER TABLE `ospos_tax_rates`
|
||||
ADD CONSTRAINT `ospos_tax_rates_ibfk_2` FOREIGN KEY (`rate_tax_code_id`) REFERENCES `ospos_tax_codes` (`tax_code_id`);
|
||||
|
||||
ALTER TABLE `ospos_tax_rates` ADD INDEX `rate_jurisdiction_id` (`rate_jurisdiction_id`);
|
||||
|
||||
ALTER TABLE `ospos_tax_rates`
|
||||
ADD CONSTRAINT `ospos_tax_rates_ibfk_3` FOREIGN KEY (`rate_jurisdiction_id`) REFERENCES `ospos_tax_jurisdictions` (`jurisdiction_id`);
|
||||
|
||||
ALTER TABLE `ospos_receivings` ADD INDEX `receiving_time` (`receiving_time`);
|
||||
|
||||
ALTER TABLE `ospos_sales_payments` ADD INDEX `payment_time` (`payment_time`);
|
||||
|
||||
ALTER TABLE `ospos_inventory` ADD INDEX `trans_date` (`trans_date`);
|
||||
Reference in New Issue
Block a user