mirror of
https://github.com/jetkvm/cloud-api.git
synced 2025-09-16 08:38:15 +00:00
26 lines
605 B
SQL
26 lines
605 B
SQL
/*
|
|
Warnings:
|
|
|
|
- You are about to drop the `Kvm` table. If the table is not empty, all the data it contains will be lost.
|
|
|
|
*/
|
|
-- DropForeignKey
|
|
ALTER TABLE "Kvm" DROP CONSTRAINT "Kvm_userId_fkey";
|
|
|
|
-- DropTable
|
|
DROP TABLE "Kvm";
|
|
|
|
-- CreateTable
|
|
CREATE TABLE "Device" (
|
|
"id" TEXT NOT NULL,
|
|
"lastSeen" TIMESTAMP(6),
|
|
"name" TEXT,
|
|
"userId" BIGINT NOT NULL
|
|
);
|
|
|
|
-- CreateIndex
|
|
CREATE UNIQUE INDEX "Device_id_key" ON "Device"("id");
|
|
|
|
-- AddForeignKey
|
|
ALTER TABLE "Device" ADD CONSTRAINT "Device_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|