Add latest changes

Dieser Commit ist enthalten in:
2025-07-03 20:38:33 +00:00
Ursprung 63f3d92724
Commit 6f6cde65db
129 geänderte Dateien mit 3998 neuen und 1199 gelöschten Zeilen

Datei anzeigen

@@ -0,0 +1,27 @@
-- Migration: Cleanup license_sessions hardware_id column
-- Date: 2025-01-03
-- Description: Migrate hardware_id data to hardware_fingerprint and remove old column
BEGIN;
-- Copy data from hardware_id to hardware_fingerprint where it's null
UPDATE license_sessions
SET hardware_fingerprint = hardware_id
WHERE hardware_fingerprint IS NULL AND hardware_id IS NOT NULL;
-- Make hardware_fingerprint NOT NULL (it should have data now)
ALTER TABLE license_sessions
ALTER COLUMN hardware_fingerprint SET NOT NULL;
-- Drop the old hardware_id column
ALTER TABLE license_sessions
DROP COLUMN hardware_id CASCADE;
-- Update the index to use hardware_fingerprint
DROP INDEX IF EXISTS idx_license_sessions_license_hardware;
CREATE INDEX idx_license_sessions_license_hardware ON license_sessions(license_id, hardware_fingerprint);
-- Add comment
COMMENT ON COLUMN license_sessions.hardware_fingerprint IS 'Unique hardware identifier for the session';
COMMIT;