merlyn/server/prisma/migrations/20250725194841_init/migration.sql
Timothy Carambat c218a0dfe3
Mobile sync support (#4173)
* WIP on mobile connections
todo: register devices
todo: data sync or connection

* improve connection flow and registration
add streaming from service
TODO: user scoping

* dev build mobile support

* fix path

* handle relative URLs

* handle localhost access in product

* add device de-register

* sync styles

* move UI to be out of the normal path since beta only

* Add user scoping to mobile connection requests
Remigrate DB for user associations
Implement temp token registration to prevent unauthorized device registration requests
cleanup middlewares
2025-07-31 12:28:03 -07:00

18 lines
680 B
SQL

-- CreateTable
CREATE TABLE "desktop_mobile_devices" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"deviceOs" TEXT NOT NULL,
"deviceName" TEXT NOT NULL,
"token" TEXT NOT NULL,
"approved" BOOLEAN NOT NULL DEFAULT false,
"userId" INTEGER,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "desktop_mobile_devices_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);
-- CreateIndex
CREATE UNIQUE INDEX "desktop_mobile_devices_token_key" ON "desktop_mobile_devices"("token");
-- CreateIndex
CREATE INDEX "desktop_mobile_devices_userId_idx" ON "desktop_mobile_devices"("userId");