From: Phil D. <ph...@du...> - 2004-02-24 21:44:51
|
BlankYes I saw that. I thought the upgrade script would work for those that already had a weberp db. Running the web_erp_demo.sql would hit snags naturally in deleting the tables where there are foreign key constraints in other tables. The upgrade script would not have a problem with this. What I haven't tried is running the script when a previous version of the db is not already existing, does this fail too? Loading the demo data from scratch with the web_erp_demo.sql should probably have the disable foreign key checks option in like you say - I will modify this. P ----- Original Message ----- From: Stins, Dick To: web...@li... Sent: Wednesday, February 25, 2004 10:18 AM Subject: [Web-erp-developers] create demo script Hoi, I tried to setup a new demo database. The foreign keys are causing some trouble. Although I think we should not use the next statement, it is a quick workaround to add to the script: mysql> SET FOREIGN_KEY_CHECKS = 0; mysql> SOURCE dump_file_name; mysql> SET FOREIGN_KEY_CHECKS = 1; To be in control, we should deliver a script which does not need this workaround. See also: http://www.mysql.com/doc/en/InnoDB_foreign_key_constraints.html The load of the demo data is also complaining about the foreign key constraints. The workaround works too, but there is a chance that the data integrity is corrupted, because I suppose that mysql does not check the data integrity (foreign keys) when the foreign keys are enabled. To be sure, we should improve the script with the ability to load the (demo) data without any problems while the foreign key checks are enabled. With best regards, Dick Stins |
From: Stins, D. <DR...@Zi...> - 2004-02-24 22:13:54
|
Phil, Dropping the tables is not the problem. MySql just drops it without any warning!!! I expect that it also does not function for an empty database. For the dataload it is too dangerous to turn foreign key checks off, because I am afraid that you might to be able to load data which is not validated by the foreign key constraints. With best regards, Dick Stins ----- Original Message ----- From: "Phil Daintree" <ph...@du...> To: "Web ERP Developers" <Web...@li...> Sent: Tuesday, February 24, 2004 10:42 PM Subject: Re: [Web-erp-developers] create demo script > BlankYes I saw that. I thought the upgrade script would work for those that > already had a weberp db. Running the web_erp_demo.sql would hit snags > naturally in deleting the tables where there are foreign key constraints in > other tables. The upgrade script would not have a problem with this. > > What I haven't tried is running the script when a previous version of the db > is not already existing, does this fail too? > > Loading the demo data from scratch with the web_erp_demo.sql should probably > have the disable foreign key checks option in like you say - I will modify > this. > > P > ----- Original Message ----- > From: Stins, Dick > To: web...@li... > Sent: Wednesday, February 25, 2004 10:18 AM > Subject: [Web-erp-developers] create demo script > > > Hoi, > > I tried to setup a new demo database. > > The foreign keys are causing some trouble. > > Although I think we should not use the next statement, it is a quick > workaround to add to the script: > > mysql> SET FOREIGN_KEY_CHECKS = 0; > mysql> SOURCE dump_file_name; > mysql> SET FOREIGN_KEY_CHECKS = 1; > To be in control, we should deliver a script which does > not need this workaround. > See also: > http://www.mysql.com/doc/en/InnoDB_foreign_key_constraints.html > The load of the demo data is also complaining about the foreign key > constraints. > > The workaround works too, but there is a chance that the data integrity > is corrupted, because I suppose that mysql does not check the data integrity > (foreign keys) when the foreign keys are enabled. > > To be sure, we should improve the script with the ability to load the > (demo) data without any problems while the foreign key checks are enabled. > > With best regards, > > Dick Stins > |
From: Phil D. <ph...@du...> - 2004-02-24 22:29:48
|
There will always be an inconsistency when creating a database for the first time - eg. DebtorTrans table is attempted to be created first - it would NOT be allowed because the SysTypes tables does not exist yet and there is a foreign key for this table which cannot be validated until the SysTypes table can be created. I found that I could not drop tables out of sequence ie one has to drop the DebtorTrans Table before the SysTypes table to ensure integrity of foreign keys. I think in the circumstances foreign keys should be disabled on the creation of new DBs. Phil ----- Original Message ----- From: "Stins, Dick" <DR...@Zi...> To: "Web ERP Developers" <Web...@li...> Sent: Wednesday, February 25, 2004 11:08 AM Subject: Re: [Web-erp-developers] create demo script > Phil, > > Dropping the tables is not the problem. MySql just drops it without any > warning!!! I expect that it also does not function for an empty database. > > For the dataload it is too dangerous to turn foreign key checks off, because > I am afraid that you might to be able to load data which is not validated by > the foreign key constraints. > > With best regards, > > Dick Stins > > ----- Original Message ----- > From: "Phil Daintree" <ph...@du...> > To: "Web ERP Developers" <Web...@li...> > Sent: Tuesday, February 24, 2004 10:42 PM > Subject: Re: [Web-erp-developers] create demo script > > > > BlankYes I saw that. I thought the upgrade script would work for those > that > > already had a weberp db. Running the web_erp_demo.sql would hit snags > > naturally in deleting the tables where there are foreign key constraints > in > > other tables. The upgrade script would not have a problem with this. > > > > What I haven't tried is running the script when a previous version of the > db > > is not already existing, does this fail too? > > > > Loading the demo data from scratch with the web_erp_demo.sql should > probably > > have the disable foreign key checks option in like you say - I will modify > > this. > > > > P > > ----- Original Message ----- > > From: Stins, Dick > > To: web...@li... > > Sent: Wednesday, February 25, 2004 10:18 AM > > Subject: [Web-erp-developers] create demo script > > > > > > Hoi, > > > > I tried to setup a new demo database. > > > > The foreign keys are causing some trouble. > > > > Although I think we should not use the next statement, it is a quick > > workaround to add to the script: > > > > mysql> SET FOREIGN_KEY_CHECKS = 0; > > mysql> SOURCE dump_file_name; > > mysql> SET FOREIGN_KEY_CHECKS = 1; > > To be in control, we should deliver a script which does > > not need this workaround. > > See also: > > http://www.mysql.com/doc/en/InnoDB_foreign_key_constraints.html > > The load of the demo data is also complaining about the foreign key > > constraints. > > > > The workaround works too, but there is a chance that the data > integrity > > is corrupted, because I suppose that mysql does not check the data > integrity > > (foreign keys) when the foreign keys are enabled. > > > > To be sure, we should improve the script with the ability to load the > > (demo) data without any problems while the foreign key checks are enabled. > > > > With best regards, > > > > Dick Stins > > > > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers > |