News:

Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com

Main Menu

Duplicate manufacturer

Started by elcano, March 14, 2006, 04:08:05 AM

Previous topic - Next topic

archived

When adding a new device I created a duplicate Manufacturer by error. How can I delete the duplicate entry?

archived

You can delete it from database. Open a MySQL console or a MySQL client and run:

use pluto_main;

SELECT PK_Manufacturer, Description FROM Manufacturer WHERE Description LIKE '%your_name_here%';


This will return the primary key of the records from database. Then delete the duplicate records using:
DELETE FROM Manufacturer WHERE PK_Manufacturer=X;
with X the primary key returned by SELECT query.

Be aware that if that manufacturer is used as foreign key for a device template, for example, by deleting it you will have an invalid key which will cause sqlCVS, the tool who make database syncronization, to crash.
You can check this with a query like:
SELECT * FROM DeviceTemplate WHERE FK_Manufacturer=X;

archived

Nice. It worked.