webERP table prefixing script
here is a listing of the php script to copy a directory structure and prefix all the tables:
I have used webERP on my own site www.eldwick.org.uk, more as an example of what can be done with online databases than for real. However I decided that I might as well put my money where my mouth is and start using it for my own accounts. Also I wanted to suggest it for routine accounts for an organisation I do some work for www.wwoof.org but both locations are on shared hosts and both have limited MySQL db allocations.
So I needed to use a table prefix system but couldn't face rehacking the whole code base so I have written a script to do it:
It seems to work but I have not tested it exhaustively! There are quite a few oddities i.e. field names or part of table name that match a table name. Possible to tighten this up a bit. I will submit it through the proper routes as well.
NB I had to change the .sql file (prior to conversion) to get it to load:
CONSTRAINT `custbranch_ibfk_3` FOREIGN KEY (`salesman`) REFERENCES `salesman` (`SalesmanCode`),
CONSTRAINT `custbranch_ibfk_3` FOREIGN KEY (`salesman`) REFERENCES `salesman` (`salesmancode`),
at the end
INSERT INTO shippers (1,'Default Shipper',0); UPDATE config SET confvalue='1' WHERE confname='Default_Shipper';
INSERT INTO shippers VALUES (1,'Default Shipper',0); UPDATE config SET confvalue='1' WHERE confname='Default_Shipper';