Advertisement
gsavix

weberp-4-11-3-mysql-constraints-duplicated

Jul 6th, 2014
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 3.34 KB | None | 0 0
  1. /* revisions for weberp 4.11.3
  2. sql for database creation (schema constraints) files: default.sql, demo.sql.weberpchina.sql;
  3. these files are inside ../sql/mysql/contry_sql/ */
  4.  
  5. /* there are 5 problems with duplicated constraints. i put comment       on */
  6.  
  7. /* ( 5 revisions for files demo.sql / default.sql / weberpchina.sql) */
  8.  
  9. /* revision 1 */
  10.  
  11. ALTER TABLE `internalstockcatrole`
  12.   ADD CONSTRAINT `internalstockcatrole_ibfk_1` FOREIGN KEY (`categoryid`) REFERENCES `stockcategory` (`categoryid`),
  13.   ADD CONSTRAINT `internalstockcatrole_ibfk_2` FOREIGN KEY (`secroleid`) REFERENCES `securityroles` (`secroleid`);
  14.   /* gsavix@gmail.com revisado em 20140706 */
  15.   /* beg-rev1
  16.   ADD CONSTRAINT `internalstockcatrole_ibfk_3` FOREIGN KEY (`categoryid`) REFERENCES `stockcategory` (`categoryid`),
  17.   ADD CONSTRAINT `internalstockcatrole_ibfk_4` FOREIGN KEY (`secroleid`) REFERENCES `securityroles` (`secroleid`);
  18.       end-rev1 */
  19.  
  20. /* revision 2 */
  21.  
  22. ALTER TABLE `stockitemproperties`
  23.   ADD CONSTRAINT `stockitemproperties_ibfk_1` FOREIGN KEY (`stockid`) REFERENCES `stockmaster` (`stockid`),
  24.   ADD CONSTRAINT `stockitemproperties_ibfk_2` FOREIGN KEY (`stkcatpropid`) REFERENCES `stockcatproperties` (`stkcatpropid`),
  25.   /* gsavix@gmail 20140706 */
  26.   /* beg-rev2
  27.   ADD CONSTRAINT `stockitemproperties_ibfk_3` FOREIGN KEY (`stockid`) REFERENCES `stockmaster` (`stockid`),
  28.   ADD CONSTRAINT `stockitemproperties_ibfk_4` FOREIGN KEY (`stkcatpropid`) REFERENCES `stockcatproperties` (`stkcatpropid`),
  29.   ADD CONSTRAINT `stockitemproperties_ibfk_5` FOREIGN KEY (`stockid`) REFERENCES `stockmaster` (`stockid`),
  30.   ADD CONSTRAINT `stockitemproperties_ibfk_6` FOREIGN KEY (`stkcatpropid`) REFERENCES `stockcatproperties` (`stkcatpropid`);
  31.       end-rev2 */
  32.  
  33. /* revision 3 */
  34.  
  35. ALTER TABLE `stockmovestaxes`
  36.   ADD CONSTRAINT `stockmovestaxes_ibfk_1` FOREIGN KEY (`taxauthid`) REFERENCES `taxauthorities` (`taxid`),
  37.   ADD CONSTRAINT `stockmovestaxes_ibfk_2` FOREIGN KEY (`stkmoveno`) REFERENCES `stockmoves` (`stkmoveno`),
  38.   /* gsavix@gmail 20140706 */
  39.   /* beg-rev3
  40.   ADD CONSTRAINT `stockmovestaxes_ibfk_3` FOREIGN KEY (`stkmoveno`) REFERENCES `stockmoves` (`stkmoveno`),
  41.   ADD CONSTRAINT `stockmovestaxes_ibfk_4` FOREIGN KEY (`stkmoveno`) REFERENCES `stockmoves` (`stkmoveno`);
  42.      end-rev3 */
  43.  
  44. /* revision 4 */
  45.  
  46. ALTER TABLE `stockrequest`
  47.   ADD CONSTRAINT `stockrequest_ibfk_1` FOREIGN KEY (`loccode`) REFERENCES `locations` (`loccode`),
  48.   ADD CONSTRAINT `stockrequest_ibfk_2` FOREIGN KEY (`departmentid`) REFERENCES `departments` (`departmentid`),
  49.   /* gsavix@gmail 20140706 */
  50.   /* beg-rev4
  51.   ADD CONSTRAINT `stockrequest_ibfk_3` FOREIGN KEY (`loccode`) REFERENCES `locations` (`loccode`),
  52.   ADD CONSTRAINT `stockrequest_ibfk_4` FOREIGN KEY (`departmentid`) REFERENCES `departments` (`departmentid`);
  53.      end-rev4 */
  54.      
  55. /* revision 5 */
  56.  
  57. ALTER TABLE `stockrequestitems`
  58.   ADD CONSTRAINT `stockrequestitems_ibfk_1` FOREIGN KEY (`dispatchid`) REFERENCES `stockrequest` (`dispatchid`),
  59.   ADD CONSTRAINT `stockrequestitems_ibfk_2` FOREIGN KEY (`stockid`) REFERENCES `stockmaster` (`stockid`),
  60.   /* gsavix@gmail 20140706 */
  61.   /* beg-rev5
  62.   ADD CONSTRAINT `stockrequestitems_ibfk_3` FOREIGN KEY (`dispatchid`) REFERENCES `stockrequest` (`dispatchid`),
  63.   ADD CONSTRAINT `stockrequestitems_ibfk_4` FOREIGN KEY (`stockid`) REFERENCES `stockmaster` (`stockid`);
  64.      end-rev5 */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement