LinuxMCE Forums

Archive => Archive => Pluto Main General Issues => Topic started by: archived on March 14, 2006, 04:08:05 am

Title: Duplicate manufacturer
Post by: archived on March 14, 2006, 04:08:05 am
When adding a new device I created a duplicate Manufacturer by error. How can I delete the duplicate entry?
Title: Duplicate manufacturer
Post by: archived on March 14, 2006, 03:59:35 pm
You can delete it from database. Open a MySQL console or a MySQL client and run:
Code: [Select]

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:
Code: [Select]
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:
Code: [Select]
SELECT * FROM DeviceTemplate WHERE FK_Manufacturer=X;
Title: Thanks
Post by: archived on March 15, 2006, 12:35:00 pm
Nice. It worked.