Advertisement
gsavix

weberp-4-11-3-rev1-mysql-constraint-key-inconsistent

Jul 8th, 2014
533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 5.48 KB | None | 0 0
  1. /*  revised by gsavix@gmail.com for weberp 4.11.3 08-jul-2014
  2.     commands for drop key for weberp tables:
  3.     banktrans,
  4.     gltrans,
  5.     mrpdemandtypes,
  6.     salescatprod,
  7.     stockrequest,
  8.     storequestitemns  */
  9.  
  10. alter table banktrans drop key ref_10, drop key ref_9, drop key ref_8, drop key ref_7;
  11. alter table banktrans drop key ref_6, drop key ref_5, drop key ref_4, drop key ref_3, drop key ref_2;
  12. alter table gltrans drop key tag_2, drop key tag_3, drop key tag_4;
  13. alter table mrpdemandtypes drop key mrpdemandtype;
  14. alter table salescatprod drop key manufacturers_id_2;
  15. alter table salescatprod drop key manufacturers_id;
  16. alter table stockrequest drop key departmentid_2;
  17. alter table stockrequest drop key loccode_2;
  18. alter table stockrequestitems drop key stockid_2, drop key dispatchid_2;
  19.  
  20.  
  21.  
  22. CREATE TABLE IF NOT EXISTS `banktrans` (
  23.   `banktransid` bigint(20) NOT NULL AUTO_INCREMENT,
  24.   `type` smallint(6) NOT NULL DEFAULT '0',
  25.   `transno` bigint(20) NOT NULL DEFAULT '0',
  26.   `bankact` varchar(20) NOT NULL DEFAULT '0',
  27.   `ref` varchar(50) NOT NULL DEFAULT '',
  28.   `amountcleared` double NOT NULL DEFAULT '0',
  29.   `exrate` double NOT NULL DEFAULT '1' COMMENT 'From bank account currency to payment currency',
  30.   `functionalexrate` double NOT NULL DEFAULT '1' COMMENT 'Account currency to functional currency',
  31.   `transdate` date NOT NULL DEFAULT '0000-00-00',
  32.   `banktranstype` varchar(30) NOT NULL DEFAULT '',
  33.   `amount` double NOT NULL DEFAULT '0',
  34.   `currcode` char(3) NOT NULL DEFAULT '',
  35.   PRIMARY KEY (`banktransid`),
  36.   KEY `BankAct` (`bankact`,`ref`),
  37.   KEY `TransDate` (`transdate`),
  38.   KEY `TransType` (`banktranstype`),
  39.   KEY `Type` (`type`,`transno`),
  40.   KEY `CurrCode` (`currcode`),
  41.   KEY `ref` (`ref`)
  42.   /* revised-081-begin by gsavix08-jul-2014
  43.   KEY `ref_2` (`ref`),
  44.   KEY `ref_3` (`ref`),
  45.   KEY `ref_4` (`ref`),
  46.   KEY `ref_5` (`ref`),
  47.   KEY `ref_6` (`ref`),
  48.   KEY `ref_7` (`ref`),
  49.   KEY `ref_8` (`ref`),
  50.   KEY `ref_9` (`ref`),
  51.   KEY `ref_10` (`ref`)
  52.   revised-081-end by gsavix08-jul-2014 */
  53. ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
  54.  
  55.  
  56. CREATE TABLE IF NOT EXISTS `gltrans` (
  57.   `counterindex` int(11) NOT NULL AUTO_INCREMENT,
  58.   `type` smallint(6) NOT NULL DEFAULT '0',
  59.   `typeno` bigint(16) NOT NULL DEFAULT '1',
  60.   `chequeno` int(11) NOT NULL DEFAULT '0',
  61.   `trandate` date NOT NULL DEFAULT '0000-00-00',
  62.   `periodno` smallint(6) NOT NULL DEFAULT '0',
  63.   `account` varchar(20) NOT NULL DEFAULT '0',
  64.   `narrative` varchar(200) NOT NULL DEFAULT '',
  65.   `amount` double NOT NULL DEFAULT '0',
  66.   `posted` tinyint(4) NOT NULL DEFAULT '0',
  67.   `jobref` varchar(20) NOT NULL DEFAULT '',
  68.   `tag` tinyint(4) NOT NULL DEFAULT '0',
  69.   PRIMARY KEY (`counterindex`),
  70.   KEY `Account` (`account`),
  71.   KEY `ChequeNo` (`chequeno`),
  72.   KEY `PeriodNo` (`periodno`),
  73.   KEY `Posted` (`posted`),
  74.   KEY `TranDate` (`trandate`),
  75.   KEY `TypeNo` (`typeno`),
  76.   KEY `Type_and_Number` (`type`,`typeno`),
  77.   KEY `JobRef` (`jobref`),
  78.   KEY `tag` (`tag`)
  79.   /* revised-082-begin by gsavix08-jul-2014
  80.   KEY `tag_2` (`tag`),
  81.   KEY `tag_3` (`tag`),
  82.   KEY `tag_4` (`tag`)
  83.   revised-082-end by gsavix08-jul-2014 */
  84. ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
  85.  
  86.  
  87.  
  88. CREATE TABLE IF NOT EXISTS `mrpdemandtypes` (
  89.   `mrpdemandtype` varchar(6) NOT NULL DEFAULT '',
  90.   `description` char(30) NOT NULL DEFAULT '',
  91.   PRIMARY KEY (`mrpdemandtype`)
  92.   /* revised-083-begin by gsavix08-jul-2014
  93.   KEY `mrpdemandtype` (`mrpdemandtype`)
  94.   revised-083-end by gsavix08-jul-2014 */
  95. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  96.  
  97. CREATE TABLE IF NOT EXISTS `salescatprod` (
  98.   `salescatid` tinyint(4) NOT NULL DEFAULT '0',
  99.   `stockid` varchar(20) NOT NULL DEFAULT '',
  100.   `manufacturers_id` int(11) NOT NULL,
  101.   `featured` tinyint(4) NOT NULL DEFAULT '0',
  102.   PRIMARY KEY (`salescatid`,`stockid`),
  103.   KEY `salescatid` (`salescatid`),
  104.   KEY `stockid` (`stockid`),
  105.   KEY `manufacturer_id` (`manufacturers_id`)
  106.   /* revised-084-begin by gsavix08-jul-2014
  107.   KEY `manufacturers_id` (`manufacturers_id`)
  108.   KEY `manufacturers_id_2` (`manufacturers_id`)
  109.   revised-084-end by gsavix08-jul-2014 */
  110. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  111.  
  112.  
  113. CREATE TABLE IF NOT EXISTS `stockrequest` (
  114.   `dispatchid` int(11) NOT NULL AUTO_INCREMENT,
  115.   `loccode` varchar(5) NOT NULL DEFAULT '',
  116.   `departmentid` int(11) NOT NULL DEFAULT '0',
  117.   `despatchdate` date NOT NULL DEFAULT '0000-00-00',
  118.   `authorised` tinyint(4) NOT NULL DEFAULT '0',
  119.   `closed` tinyint(4) NOT NULL DEFAULT '0',
  120.   `narrative` text NOT NULL,
  121.   PRIMARY KEY (`dispatchid`),
  122.   KEY `loccode` (`loccode`),
  123.   KEY `departmentid` (`departmentid`)
  124.   /* revised-085-begin by gsavix08-jul-2014
  125.   KEY `loccode_2` (`loccode`),
  126.   KEY `departmentid_2` (`departmentid`)
  127.   revised-085-end by gsavix08-jul-2014 */
  128. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  129.  
  130.  
  131. CREATE TABLE IF NOT EXISTS `stockrequestitems` (
  132.   `dispatchitemsid` int(11) NOT NULL DEFAULT '0',
  133.   `dispatchid` int(11) NOT NULL DEFAULT '0',
  134.   `stockid` varchar(20) NOT NULL DEFAULT '',
  135.   `quantity` double NOT NULL DEFAULT '0',
  136.   `qtydelivered` double NOT NULL DEFAULT '0',
  137.   `decimalplaces` int(11) NOT NULL DEFAULT '0',
  138.   `uom` varchar(20) NOT NULL DEFAULT '',
  139.   `completed` tinyint(4) NOT NULL DEFAULT '0',
  140.   PRIMARY KEY (`dispatchitemsid`,`dispatchid`),
  141.   KEY `dispatchid` (`dispatchid`),
  142.   KEY `stockid` (`stockid`)
  143.   /* revised-086-begin by gsavix08-jul-2014
  144.   KEY `dispatchid_2` (`dispatchid`),
  145.   KEY `stockid_2` (`stockid`)
  146.   revised-086-end by gsavix08-jul-2014 */
  147. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement