API-Key - Fix - Nicht mehr mehrere

Dieser Commit ist enthalten in:
2025-06-22 13:25:10 +02:00
Ursprung 889a7b4ebe
Commit 4ed8889589
5 geänderte Dateien mit 70 neuen und 15 gelöschten Zeilen

Datei anzeigen

@@ -0,0 +1,17 @@
-- Cleanup orphaned API-related tables
-- Since admin panel is exclusively for Account Forger, we only need system_api_key table
-- Drop tables that depend on api_clients
DROP TABLE IF EXISTS rate_limits CASCADE;
DROP TABLE IF EXISTS license_events CASCADE;
-- Drop orphaned API tables
DROP TABLE IF EXISTS api_clients CASCADE;
DROP TABLE IF EXISTS api_keys CASCADE;
-- Add comments to document the single API key system
COMMENT ON TABLE system_api_key IS 'Single API key table for Account Forger authentication. This is the ONLY API key system in use.';
-- Log the cleanup
INSERT INTO audit_log (username, action, entity_type, details, ip_address)
VALUES ('SYSTEM', 'CLEANUP', 'database', 'Removed orphaned API tables: api_keys, api_clients, rate_limits, license_events', '127.0.0.1');

Datei anzeigen

@@ -0,0 +1,9 @@
-- Remove duplicate API key from client_configs table
-- Since admin panel is exclusively for Account Forger, we only need system_api_key
-- Remove the api_key column from client_configs
ALTER TABLE client_configs DROP COLUMN IF EXISTS api_key;
-- Update description
COMMENT ON TABLE client_configs IS 'Configuration for Account Forger client (versions, timeouts)';
COMMENT ON TABLE system_api_key IS 'Single API key for Account Forger authentication';