Jump to content



Issue Information

  • #000549

  • 0 - None Assigned

  • New

  • 2.3.2

  • -

Issue Confirmations

  • Yes (0)No (0)
Photo

oscommerce.sql

Posted by Chris H on 05 December 2012 - 11:33 AM

Thinking about the merchant who is updating an old version of osC. And who decides to not go through the successive upgrades (I don't know if this is necessary) but to do it all in one step with a new install. It might not occur to him that

install/oscommerce.sql

with its lines like

DROP TABLE IF EXISTS action_recorder;

will wipe out his whole database. This sql file is a menace. Perhaps it could be under the control of a pre-ticked installation checkbox, with a name like 'retain old database'. Alternatively there is the sql command

CREATE TABLE IF NOT EXISTS

but new records will still be inserted. Which is probably not what is wanted.

Hi @Chris

good idea but unfortunately there are a lot of SQL differents which can handle in php only. mySQL procedure, events and functions are not available most of web servers.

Hi, I have just tried to import a db for a new client. That failed with because if the

DROP TABLE IF EXISTS action_recorder;

That's serious. And, whats more, suppose you need to import an old DB, from a backup.
I think that will fail to.

A guide line or a fix is urgent.

Sara

I have just done some testing and found a way to do it:

For import:
Remove all instances of DROP TABLE IF EXISTS ......

After upload, run this command:

ALTER DATABASE roxensbi_u2com CHARACTER SET utf8 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT COLLATE utf8_unicode_ci;

To ensure full UTF-8 support

As usual, you have to create the DB and it's user

Sara