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 @@
-- Migrate activations table to new column names
-- Add new columns
ALTER TABLE activations
ADD COLUMN IF NOT EXISTS machine_name VARCHAR(255),
ADD COLUMN IF NOT EXISTS hardware_fingerprint VARCHAR(255);
-- Copy data from old to new columns
UPDATE activations
SET machine_name = COALESCE(device_name, machine_id),
hardware_fingerprint = hardware_hash
WHERE machine_name IS NULL OR hardware_fingerprint IS NULL;
-- Make new columns NOT NULL after data is copied
ALTER TABLE activations
ALTER COLUMN machine_name SET NOT NULL,
ALTER COLUMN hardware_fingerprint SET NOT NULL;
-- Drop old columns
ALTER TABLE activations
DROP COLUMN IF EXISTS machine_id,
DROP COLUMN IF EXISTS hardware_hash,
DROP COLUMN IF EXISTS device_name;
-- Update any indexes
CREATE INDEX IF NOT EXISTS idx_activations_machine_name ON activations(machine_name);
CREATE INDEX IF NOT EXISTS idx_activations_hardware_fingerprint ON activations(hardware_fingerprint);