Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
achul123 committed Nov 20, 2024
1 parent 1fbee6d commit 9d9d1e5
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 146 deletions.
10 changes: 0 additions & 10 deletions prisma/migrations/20241109231311_init/migration.sql

This file was deleted.

50 changes: 0 additions & 50 deletions prisma/migrations/20241118202805_init/migration.sql

This file was deleted.

10 changes: 0 additions & 10 deletions prisma/migrations/20241118203012_init/migration.sql

This file was deleted.

26 changes: 0 additions & 26 deletions prisma/migrations/20241118205644_init/migration.sql

This file was deleted.

21 changes: 0 additions & 21 deletions prisma/migrations/20241118210749_init/migration.sql

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ CREATE TABLE "Server" (
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"ownerId" INTEGER NOT NULL,
"nodeId" INTEGER NOT NULL,
CONSTRAINT "Server_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "Users" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Server_nodeId_fkey" FOREIGN KEY ("nodeId") REFERENCES "Node" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
CONSTRAINT "Server_nodeId_fkey" FOREIGN KEY ("nodeId") REFERENCES "Node" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Server_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "Users" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);

-- CreateTable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
Warnings:
- Added the required column `Ports` to the `Server` table without a default value. This is not possible if the table is not empty.
- The required column `UUID` was added to the `Server` table with a prisma-level default value. This is not possible if the table is not empty. Please add this column as optional, then populate it before making it required.
*/
Expand All @@ -12,10 +13,12 @@ CREATE TABLE "new_Server" (
"UUID" TEXT NOT NULL,
"name" TEXT NOT NULL,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"Ports" TEXT NOT NULL,
"Suspended" BOOLEAN NOT NULL DEFAULT false,
"ownerId" INTEGER NOT NULL,
"nodeId" INTEGER NOT NULL,
CONSTRAINT "Server_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "Users" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Server_nodeId_fkey" FOREIGN KEY ("nodeId") REFERENCES "Node" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
CONSTRAINT "Server_nodeId_fkey" FOREIGN KEY ("nodeId") REFERENCES "Node" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Server_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "Users" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Server" ("createdAt", "id", "name", "nodeId", "ownerId") SELECT "createdAt", "id", "name", "nodeId", "ownerId" FROM "Server";
DROP TABLE "Server";
Expand Down
50 changes: 25 additions & 25 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ datasource db {
}

model Users {
id Int @id @default(autoincrement())
email String @unique
username String?
password String
isAdmin Boolean @default(false)
description String? @default("No About Me")
servers Server[]
id Int @id @default(autoincrement())
email String @unique
username String?
password String
isAdmin Boolean @default(false)
description String? @default("No About Me")
servers Server[]
}

model Session {
id String @id @default(cuid())
session_id String @unique
data String
expires DateTime
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
id String @id @default(cuid())
session_id String @unique
data String
expires DateTime
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}

model Server {
Expand All @@ -34,21 +34,21 @@ model Server {
Ports String
Suspended Boolean @default(false)
ownerId Int
owner Users @relation(fields: [ownerId], references: [id])
nodeId Int
node Node @relation(fields: [nodeId], references: [id])
owner Users @relation(fields: [ownerId], references: [id])
}

model Node {
id Int @id @default(autoincrement())
name String
ram Int @default(0)
cpu Int @default(0)
disk Int @default(0)
address String @default("127.0.0.1")
port Int @default(3001)
key String
apiKey String @default("")
createdAt DateTime @default(now())
servers Server[]
id Int @id @default(autoincrement())
name String
ram Int @default(0)
cpu Int @default(0)
disk Int @default(0)
address String @default("127.0.0.1")
port Int @default(3001)
key String
apiKey String @default("")
createdAt DateTime @default(now())
servers Server[]
}

0 comments on commit 9d9d1e5

Please sign in to comment.