ARCHIVE
LinuxMCE Forums
May 20, 2013, 03:32:21 am GMT-1 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
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
 
   Home   Help Search Chat Login Register  
Pages: [1]
  Print  
Author Topic: Duplicate manufacturer  (Read 833 times)
archived
Hello, I'm new here

Posts: 0


View Profile
« 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?
Logged
archived
Hello, I'm new here

Posts: 0


View Profile
« Reply #1 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:

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:
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 * FROM DeviceTemplate WHERE FK_Manufacturer=X;
Logged
archived
Hello, I'm new here

Posts: 0


View Profile
« Reply #2 on: March 15, 2006, 12:35:00 pm »

Nice. It worked.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Pluto provided a snapshot of their forums with approximately 5,000 posts in February, 2007 when LinuxMCE branched off. Browse those forum posts in the Archive section. Those posts have been included in the search engine and can be found with keyword searches.