add pg 1.9.0 migration

This commit is contained in:
miloschwartz 2025-08-18 15:29:04 -07:00
parent ac8b546393
commit 378de19f41
No known key found for this signature in database
4 changed files with 128 additions and 11 deletions

View file

@ -100,7 +100,7 @@ CREATE TABLE '__new_clients' (
FOREIGN KEY ('exitNode') REFERENCES 'exitNodes'('exitNodeId') ON UPDATE no action ON DELETE set null
);
--> statement-breakpoint
INSERT INTO '__new_clients'("id", "orgId", "exitNode", "name", "pubKey", "subnet", "bytesIn", "bytesOut", "lastBandwidthUpdate", "lastPing", "type", "online", "lastHolePunch") SELECT "id", "orgId", "exitNode", "name", "pubKey", "subnet", "bytesIn", "bytesOut", "lastBandwidthUpdate", "lastPing", "type", "online", "lastHolePunch" FROM 'clients';--> statement-breakpoint
INSERT INTO '__new_clients'("id", "orgId", "exitNode", "name", "pubKey", "subnet", "bytesIn", "bytesOut", "lastBandwidthUpdate", "lastPing", "type", "online", "lastHolePunch") SELECT "id", "orgId", "exitNode", "name", "pubKey", "subnet", "bytesIn", "bytesOut", "lastBandwidthUpdate", NULL, "type", "online", "lastHolePunch" FROM 'clients';--> statement-breakpoint
DROP TABLE 'clients';--> statement-breakpoint
ALTER TABLE '__new_clients' RENAME TO 'clients';--> statement-breakpoint
ALTER TABLE 'clientSites' ADD 'endpoint' text;--> statement-breakpoint