mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-30 11:56:48 -04:00
Revert tables.sql to original 3.0 (#68)
This commit is contained in:
@@ -118,22 +118,6 @@ ALTER TABLE `ospos_suppliers`
|
||||
ALTER TABLE `ospos_giftcards`
|
||||
ADD CONSTRAINT `ospos_giftcards_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_attribute_definitions`
|
||||
--
|
||||
ALTER TABLE `ospos_attribute_definitions`
|
||||
ADD CONSTRAINT `fk_ospos_attribute_definitions_ibfk_1` FOREIGN KEY (`definition_fk`) REFERENCES `ospos_attribute_definitions` (`definition_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_attribute_links`
|
||||
--
|
||||
ALTER TABLE `ospos_attribute_links`
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_1` FOREIGN KEY (`definition_id`) REFERENCES `ospos_attribute_definitions` (`definition_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_2` FOREIGN KEY (`attribute_id`) REFERENCES `ospos_attribute_values` (`attribute_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_3` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`),
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_4` FOREIGN KEY (`receiving_id`) REFERENCES `ospos_receivings` (`receiving_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_5` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`) ON DELETE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_customers_points`
|
||||
--
|
||||
@@ -146,4 +130,4 @@ ALTER TABLE `ospos_customers_points`
|
||||
-- Constraints for table `ospos_sales_reward_points`
|
||||
--
|
||||
ALTER TABLE `ospos_sales_reward_points`
|
||||
ADD CONSTRAINT `ospos_sales_reward_points_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales_items` (`sale_id`);
|
||||
ADD CONSTRAINT `ospos_sales_reward_points_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`);
|
||||
|
||||
@@ -248,6 +248,16 @@ CREATE TABLE `ospos_items` (
|
||||
`pack_name` varchar(8) DEFAULT '',
|
||||
`low_sell_item_id` int(10) DEFAULT 0,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
`custom1` VARCHAR(255) DEFAULT NULL,
|
||||
`custom2` VARCHAR(255) DEFAULT NULL,
|
||||
`custom3` VARCHAR(255) DEFAULT NULL,
|
||||
`custom4` VARCHAR(255) DEFAULT NULL,
|
||||
`custom5` VARCHAR(255) DEFAULT NULL,
|
||||
`custom6` VARCHAR(255) DEFAULT NULL,
|
||||
`custom7` VARCHAR(255) DEFAULT NULL,
|
||||
`custom8` VARCHAR(255) DEFAULT NULL,
|
||||
`custom9` VARCHAR(255) DEFAULT NULL,
|
||||
`custom10` VARCHAR(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`item_id`),
|
||||
KEY `item_number` (`item_number`),
|
||||
KEY `supplier_id` (`supplier_id`)
|
||||
@@ -353,7 +363,7 @@ CREATE TABLE `ospos_modules` (
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES
|
||||
('module_config', 'module_config_desc', 120, 'config'),
|
||||
('module_config', 'module_config_desc', 110, 'config'),
|
||||
('module_customers', 'module_customers_desc', 10, 'customers'),
|
||||
('module_employees', 'module_employees_desc', 80, 'employees'),
|
||||
('module_giftcards', 'module_giftcards_desc', 90, 'giftcards'),
|
||||
@@ -366,8 +376,7 @@ INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_i
|
||||
('module_reports', 'module_reports_desc', 50, 'reports'),
|
||||
('module_sales', 'module_sales_desc', 70, 'sales'),
|
||||
('module_suppliers', 'module_suppliers_desc', 40, 'suppliers'),
|
||||
('module_taxes', 'module_taxes_desc', 105, 'taxes'),
|
||||
('module_attributes', 'module_attributes_desc', 110, 'attributes');
|
||||
('module_taxes', 'module_taxes_desc', 105, 'taxes');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -443,8 +452,7 @@ INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES
|
||||
('sales', 'sales'),
|
||||
('config', 'config'),
|
||||
('suppliers', 'suppliers'),
|
||||
('taxes', 'taxes'),
|
||||
('attributes', 'attributes');
|
||||
('taxes', 'taxes');
|
||||
|
||||
|
||||
|
||||
@@ -499,7 +507,6 @@ INSERT INTO `ospos_grants` (`permission_id`, `person_id`, `menu_group`) VALUES
|
||||
('suppliers', 1, 'home'),
|
||||
('taxes', 1, 'office'),
|
||||
('office', 1, 'home'),
|
||||
('attributes', 1, 'office'),
|
||||
('home', 1, 'office');
|
||||
|
||||
--
|
||||
@@ -802,69 +809,6 @@ CREATE TABLE IF NOT EXISTS `ospos_tax_code_rates` (
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_attribute_definitions`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_attribute_definitions` (
|
||||
`definition_id` INT(10) NOT NULL AUTO_INCREMENT,
|
||||
`definition_name` VARCHAR(255) NOT NULL,
|
||||
`definition_type` VARCHAR(45) NOT NULL,
|
||||
`definition_flags` TINYINT(4) NOT NULL,
|
||||
`definition_fk` INT(10) NULL,
|
||||
`deleted` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`definition_id`),
|
||||
KEY `definition_fk` (`definition_fk`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_attribute_definitions`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_attribute_values`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_attribute_values` (
|
||||
`attribute_id` INT NOT NULL AUTO_INCREMENT,
|
||||
`attribute_value` VARCHAR(45) NULL,
|
||||
`attribute_datetime` DATETIME NULL,
|
||||
PRIMARY KEY (`attribute_id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
|
||||
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_attribute_values`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_attribute_links`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_attribute_links` (
|
||||
`attribute_id` INT NULL,
|
||||
`definition_id` INT NOT NULL,
|
||||
`item_id` INT NULL,
|
||||
`sale_id` INT NULL,
|
||||
`receiving_id` INT NULL,
|
||||
KEY `attribute_id` (`attribute_id`),
|
||||
KEY `definition_id` (`definition_id`),
|
||||
KEY `item_id` (`item_id`),
|
||||
KEY `sale_id` (`sale_id`),
|
||||
KEY `receiving_id` (`receiving_id`),
|
||||
UNIQUE `attribute_links_uq1` (`attribute_id`, `definition_id`, `item_id`, `sale_id`, `receiving_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_attribute_links`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user