Fix 4->5 migration
All checks were successful
Build Docker and Deploy / Build Docker Container (push) Successful in 2m1s
Build Docker and Deploy / Deploy to Server (push) Successful in 7s

This commit is contained in:
Mike Schwörer 2024-06-01 14:15:47 +02:00
parent a078ecaf7e
commit 0560330f68
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF

View File

@ -21,7 +21,15 @@ CREATE TABLE clients_new
PRIMARY KEY (client_id)
) STRICT;
INSERT INTO clients_new SELECT * FROM clients;
UPDATE clients SET agent_model = 'UNKNOWN' WHERE agent_model IS NULL;
UPDATE clients SET agent_version = 'UNKNOWN' WHERE agent_version IS NULL;
INSERT INTO clients_new
SELECT
client_id, user_id, type, fcm_token, name, timestamp_created, agent_model, agent_version
FROM clients;
DROP TABLE clients;
ALTER TABLE clients_new RENAME TO clients;