Modify

Opened 9 years ago

Closed 9 years ago

#1075 closed Erweiterung (fixed)

Erweiterung der "/admin/includes/modules/security_check.php" um Möglichkeit die doppelten configuration Einträge direkt zu löschen

Reported by: Torsten Riemer Owned by: somebody
Priority: hoch Milestone: modified-shop-2.0.2.0
Component: Admin Version: 2.0.0.0
Keywords: Cc:
Blocked By: Blocking:

Description

Es wäre sehr hilfreich die doppelten Einträge in der Tabelle "configuration" auch direkt bei der Ausgabe der Warnungen auf der Seite "/admin/start.php" löschen zu können.
Zusätzlich wäre es sinnvoll die doppelten Einträge zu sortieren nach "configuration_key".

Folgender SQL-Befehl zeigt alle doppelten Einträge in der Tabelle "configuration" an:

SELECT *
FROM configuration
WHERE EXISTS (
SELECT configuration_key FROM configuration Dup WHERE configuration.configuration_key = Dup.configuration_key AND configuration.configuration_id <> Dup.configuration_id)
ORDER BY configuration_key;

Und folgender SQL-Befehl löscht die zuletzt hinzugefügten "configuration_key" Einträge, da eh immer nur das erste Vorkommen als Konstante definiert wird und diese nicht überschrieben werden kann:

DELETE FROM configuration
USING configuration, configuration as Dup
WHERE NOT configuration.configuration_id = Dup.configuration_id
AND configuration.configuration_id > Dup.configuration_id
AND configuration.configuration_key = Dup.configuration_key;

Attachments (0)

Change History (2)

comment:1 by arno@…, 9 years ago

Warum nicht mittels unique key in der Datenbank das Anlegen eines doppelten Keys ein für alle mal verhindern?

comment:2 by Gerhard Waldemair, 9 years ago

Resolution: fixed
Status: newclosed

In 10459:

fix #189, #1075

Modify Ticket

Action
as closed The owner will remain somebody.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.