Add prisma schema (and update)

This commit is contained in:
2026-04-09 03:48:13 -04:00
parent 91fa274df8
commit 61c75df368
5 changed files with 227 additions and 57 deletions

View File

@@ -27,6 +27,9 @@ jobs:
- name: Install Dependencies - name: Install Dependencies
run: npm ci --include=dev run: npm ci --include=dev
- name: Generate Prisma Types
run: npx prisma generate
- name: Check Formatting - name: Check Formatting
run: npm run check-format run: npm run check-format

108
package-lock.json generated
View File

@@ -12,8 +12,8 @@
"@emotion/react": "^11.14.0", "@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1", "@emotion/styled": "^11.14.1",
"@fontsource-variable/plus-jakarta-sans": "^5.2.8", "@fontsource-variable/plus-jakarta-sans": "^5.2.8",
"@prisma/adapter-d1": "^7.6.0", "@prisma/adapter-d1": "^7.7.0",
"@prisma/client": "^7.6.0", "@prisma/client": "^7.7.0",
"@remix-run/cloudflare": "^2.17.4", "@remix-run/cloudflare": "^2.17.4",
"@remix-run/cloudflare-pages": "^2.17.4", "@remix-run/cloudflare-pages": "^2.17.4",
"@remix-run/react": "^2.17.4", "@remix-run/react": "^2.17.4",
@@ -34,7 +34,7 @@
"@types/react-dom": "^18.3.7", "@types/react-dom": "^18.3.7",
"dotenv": "^17.3.1", "dotenv": "^17.3.1",
"prettier": "^3.8.1", "prettier": "^3.8.1",
"prisma": "^7.6.0", "prisma": "^7.7.0",
"typescript": "^5.9.3" "typescript": "^5.9.3"
} }
}, },
@@ -1923,23 +1923,23 @@
} }
}, },
"node_modules/@prisma/adapter-d1": { "node_modules/@prisma/adapter-d1": {
"version": "7.6.0", "version": "7.7.0",
"resolved": "https://registry.npmjs.org/@prisma/adapter-d1/-/adapter-d1-7.6.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/adapter-d1/-/adapter-d1-7.7.0.tgz",
"integrity": "sha512-HkGjSDIQ9bL0s4j5LccGV4dICxPK8V4eljZln1iesfLe1VjO1IFpj+LNc9mVkqPL2oqZysvP3p38w4tOMzlduA==", "integrity": "sha512-0+lJsHqm+TXxXdGCCMFouNcJMVE029g6td/vRM7EhWoJYtvakwCzdzJqCQEaGPjCAPi6lzar4DAtEi7z04qjIA==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@cloudflare/workers-types": "^4.20251014.0", "@cloudflare/workers-types": "^4.20251014.0",
"@prisma/driver-adapter-utils": "7.6.0", "@prisma/driver-adapter-utils": "7.7.0",
"ky": "1.7.5" "ky": "1.7.5"
} }
}, },
"node_modules/@prisma/client": { "node_modules/@prisma/client": {
"version": "7.6.0", "version": "7.7.0",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-7.6.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/client/-/client-7.7.0.tgz",
"integrity": "sha512-7Pe/1ayh3GgWPEg4mmT4ax77LJ1wC+XlnIFvQ94bLP2DsUnOpnruQQR3Jw7r+Frthk94QqDNxo3FjSg8h9PXeQ==", "integrity": "sha512-5Ar4OsZpJ54s21sy5oDNNW9gQtd4NuxCaiM7+JDTOU07D6VvlpLjYzAVCMB1+JzokN+08dAVomlx+b7bhJd3ww==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@prisma/client-runtime-utils": "7.6.0" "@prisma/client-runtime-utils": "7.7.0"
}, },
"engines": { "engines": {
"node": "^20.19 || ^22.12 || >=24.0" "node": "^20.19 || ^22.12 || >=24.0"
@@ -1958,15 +1958,15 @@
} }
}, },
"node_modules/@prisma/client-runtime-utils": { "node_modules/@prisma/client-runtime-utils": {
"version": "7.6.0", "version": "7.7.0",
"resolved": "https://registry.npmjs.org/@prisma/client-runtime-utils/-/client-runtime-utils-7.6.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/client-runtime-utils/-/client-runtime-utils-7.7.0.tgz",
"integrity": "sha512-fD7jlqubsZvVODKvsp9lOpXVecx2aWGxC2l35Ioz2t+teUJ5CfR0SAMsi7UkU1VvaZmmm+DS6BdujF622nY7tQ==", "integrity": "sha512-BLyd0UpFYOtyJFTHm7jS9vesHW7P83abibodQMiIofqjBKzDHQ1VAsQkdfvXyYDkPlONPfOTz7/rv3x/+CQqvQ==",
"license": "Apache-2.0" "license": "Apache-2.0"
}, },
"node_modules/@prisma/config": { "node_modules/@prisma/config": {
"version": "7.6.0", "version": "7.7.0",
"resolved": "https://registry.npmjs.org/@prisma/config/-/config-7.6.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/config/-/config-7.7.0.tgz",
"integrity": "sha512-MuAz1MK4PeG5/03YzfzX3CnFVHQ6qePGwUpQRzPzX5tT0ffJ3Tzi9zJZbBc+VzEGFCM8ghW/gTVDR85Syjt+Yw==", "integrity": "sha512-hmPI3tKLO2aP0Y5vugbjcnA9qqlfJndiT6ds4tw28U5hNHLWg+mHJEWAhjsSPgxjtmxhJ/EDIeIlyh+3Us0OPg==",
"devOptional": true, "devOptional": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
@@ -1977,9 +1977,9 @@
} }
}, },
"node_modules/@prisma/debug": { "node_modules/@prisma/debug": {
"version": "7.6.0", "version": "7.7.0",
"resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-7.6.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-7.7.0.tgz",
"integrity": "sha512-LpHr3qos4lQZ6sxwjStf59YBht7m9/QF7NSQsMH6qGENWZu2w3UkQUGn1h5iRkDjnWRj3VHykOu9qFhps4ADvA==", "integrity": "sha512-12J62XdqCmpiwJHhHdQxZeY3ckVCWIFmcJP8hg5dPTceeiQ0wiojXGFYTluKqFQfu46fRLgb/rLALZMAx3+dTA==",
"license": "Apache-2.0" "license": "Apache-2.0"
}, },
"node_modules/@prisma/dev": { "node_modules/@prisma/dev": {
@@ -2016,26 +2016,26 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@prisma/driver-adapter-utils": { "node_modules/@prisma/driver-adapter-utils": {
"version": "7.6.0", "version": "7.7.0",
"resolved": "https://registry.npmjs.org/@prisma/driver-adapter-utils/-/driver-adapter-utils-7.6.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/driver-adapter-utils/-/driver-adapter-utils-7.7.0.tgz",
"integrity": "sha512-D8j3p0RnhLuufMaRLX6QqtGgPC5Ao3l5oFP6Q5AL0rTHi4vna+NzGEipwCsfvcSvaGFCbsH3lsTMbb4WvY+ovA==", "integrity": "sha512-gZXREeu6mOk7zXfGFJgh86p7Vhj0sXNKp+4Cg1tWYo7V2dfncP2qxS2BiTmbIIha8xPqItkl0WSw38RuSq1HoQ==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@prisma/debug": "7.6.0" "@prisma/debug": "7.7.0"
} }
}, },
"node_modules/@prisma/engines": { "node_modules/@prisma/engines": {
"version": "7.6.0", "version": "7.7.0",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-7.6.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-7.7.0.tgz",
"integrity": "sha512-Sn5edRzhHqgRV2M+A0eIbY442B4mReWWf3pKs/LKreYgW7oa/up8JtK/s4iv/EQA097cyboZ08mmkpbLp+tZ3w==", "integrity": "sha512-7fmcbT7HHXBq/b+3h/dO1JI3fd8l8q7erf7xP7pRprh58hmSSnG8mg9K3yjW3h9WaHWUwngVFpSxxxivaitQ2w==",
"devOptional": true, "devOptional": true,
"hasInstallScript": true, "hasInstallScript": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@prisma/debug": "7.6.0", "@prisma/debug": "7.7.0",
"@prisma/engines-version": "7.6.0-1.75cbdc1eb7150937890ad5465d861175c6624711", "@prisma/engines-version": "7.6.0-1.75cbdc1eb7150937890ad5465d861175c6624711",
"@prisma/fetch-engine": "7.6.0", "@prisma/fetch-engine": "7.7.0",
"@prisma/get-platform": "7.6.0" "@prisma/get-platform": "7.7.0"
} }
}, },
"node_modules/@prisma/engines-version": { "node_modules/@prisma/engines-version": {
@@ -2046,35 +2046,35 @@
"license": "Apache-2.0" "license": "Apache-2.0"
}, },
"node_modules/@prisma/engines/node_modules/@prisma/get-platform": { "node_modules/@prisma/engines/node_modules/@prisma/get-platform": {
"version": "7.6.0", "version": "7.7.0",
"resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-7.6.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-7.7.0.tgz",
"integrity": "sha512-ohZDwXvtmnbzOcutR2D13lDWpZP1wQjmPyztmt0AwXLzQI7q95EE7NYCvS+M6N6SivT+BM0NOqLmTH3wms4L3A==", "integrity": "sha512-MEUNzvKxvYnJ7kgvd6oNRnMmmiGNS9TYLB2weMeIXplnHdL/UWEGnvavYGnN7KLJ2n0iI4dDAyzSkHI3c7AscQ==",
"devOptional": true, "devOptional": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@prisma/debug": "7.6.0" "@prisma/debug": "7.7.0"
} }
}, },
"node_modules/@prisma/fetch-engine": { "node_modules/@prisma/fetch-engine": {
"version": "7.6.0", "version": "7.7.0",
"resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-7.6.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-7.7.0.tgz",
"integrity": "sha512-N575Ni95c3FkduWY/eKTHqNYgNbceZ1tQaSknVtJjpKmiiBXmniESn/GTxsDvICC4ZeiNrXxioGInzQrCdx16w==", "integrity": "sha512-TfyzveBQoK4xALzsTpVhB/0KG1N8zOK0ap+RnBMkzGUu3f98fnQ4QtXa2wlKPhsO2X8a3N5ugFQgcKNoHGmDfw==",
"devOptional": true, "devOptional": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@prisma/debug": "7.6.0", "@prisma/debug": "7.7.0",
"@prisma/engines-version": "7.6.0-1.75cbdc1eb7150937890ad5465d861175c6624711", "@prisma/engines-version": "7.6.0-1.75cbdc1eb7150937890ad5465d861175c6624711",
"@prisma/get-platform": "7.6.0" "@prisma/get-platform": "7.7.0"
} }
}, },
"node_modules/@prisma/fetch-engine/node_modules/@prisma/get-platform": { "node_modules/@prisma/fetch-engine/node_modules/@prisma/get-platform": {
"version": "7.6.0", "version": "7.7.0",
"resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-7.6.0.tgz", "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-7.7.0.tgz",
"integrity": "sha512-ohZDwXvtmnbzOcutR2D13lDWpZP1wQjmPyztmt0AwXLzQI7q95EE7NYCvS+M6N6SivT+BM0NOqLmTH3wms4L3A==", "integrity": "sha512-MEUNzvKxvYnJ7kgvd6oNRnMmmiGNS9TYLB2weMeIXplnHdL/UWEGnvavYGnN7KLJ2n0iI4dDAyzSkHI3c7AscQ==",
"devOptional": true, "devOptional": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@prisma/debug": "7.6.0" "@prisma/debug": "7.7.0"
} }
}, },
"node_modules/@prisma/get-platform": { "node_modules/@prisma/get-platform": {
@@ -4796,9 +4796,9 @@
} }
}, },
"node_modules/defu": { "node_modules/defu": {
"version": "6.1.6", "version": "6.1.7",
"resolved": "https://registry.npmjs.org/defu/-/defu-6.1.6.tgz", "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.7.tgz",
"integrity": "sha512-f8mefEW4WIVg4LckePx3mALjQSPQgFlg9U8yaPdlsbdYcHQyj9n2zL2LJEA52smeYxOvmd/nB7TpMtHGMTHcug==", "integrity": "sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==",
"devOptional": true, "devOptional": true,
"license": "MIT" "license": "MIT"
}, },
@@ -8611,16 +8611,16 @@
} }
}, },
"node_modules/prisma": { "node_modules/prisma": {
"version": "7.6.0", "version": "7.7.0",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-7.6.0.tgz", "resolved": "https://registry.npmjs.org/prisma/-/prisma-7.7.0.tgz",
"integrity": "sha512-OKJIPT81K3+F+AayIkY/Y3mkF2NWoFh7lZApaaqPYy7EHILKdO0VsmGkP+hDKYTySHsFSyLWXm/JgcR1B8fY1Q==", "integrity": "sha512-HlgwRBt1uEFB9LStHL4HLYDvoi4BNu1rYA0hPG0zCAEyK9SaZBqp7E5Rjpc3Qh8Lex/ye/svoHZ0OWoFNhWxuQ==",
"devOptional": true, "devOptional": true,
"hasInstallScript": true, "hasInstallScript": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@prisma/config": "7.6.0", "@prisma/config": "7.7.0",
"@prisma/dev": "0.24.3", "@prisma/dev": "0.24.3",
"@prisma/engines": "7.6.0", "@prisma/engines": "7.7.0",
"@prisma/studio-core": "0.27.3", "@prisma/studio-core": "0.27.3",
"mysql2": "3.15.3", "mysql2": "3.15.3",
"postgres": "3.4.7" "postgres": "3.4.7"
@@ -9946,9 +9946,9 @@
} }
}, },
"node_modules/tinyexec": { "node_modules/tinyexec": {
"version": "1.0.4", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.4.tgz", "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.1.1.tgz",
"integrity": "sha512-u9r3uZC0bdpGOXtlxUIdwf9pkmvhqJdrVCH9fapQtgy/OeTTMZ1nqH7agtvEfmGui6e1XxjcdrlxvxJvc3sMqw==", "integrity": "sha512-VKS/ZaQhhkKFMANmAOhhXVoIfBXblQxGX1myCQ2faQrfmobMftXeJPcZGp0gS07ocvGJWDLZGyOZDadDBqYIJg==",
"devOptional": true, "devOptional": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {

View File

@@ -14,8 +14,8 @@
"@emotion/react": "^11.14.0", "@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1", "@emotion/styled": "^11.14.1",
"@fontsource-variable/plus-jakarta-sans": "^5.2.8", "@fontsource-variable/plus-jakarta-sans": "^5.2.8",
"@prisma/adapter-d1": "^7.6.0", "@prisma/adapter-d1": "^7.7.0",
"@prisma/client": "^7.6.0", "@prisma/client": "^7.7.0",
"@remix-run/cloudflare": "^2.17.4", "@remix-run/cloudflare": "^2.17.4",
"@remix-run/cloudflare-pages": "^2.17.4", "@remix-run/cloudflare-pages": "^2.17.4",
"@remix-run/react": "^2.17.4", "@remix-run/react": "^2.17.4",
@@ -36,7 +36,7 @@
"@types/react-dom": "^18.3.7", "@types/react-dom": "^18.3.7",
"dotenv": "^17.3.1", "dotenv": "^17.3.1",
"prettier": "^3.8.1", "prettier": "^3.8.1",
"prisma": "^7.6.0", "prisma": "^7.7.0",
"typescript": "^5.9.3" "typescript": "^5.9.3"
}, },
"overrides": { "overrides": {

12
prisma.config.ts Normal file
View File

@@ -0,0 +1,12 @@
import "dotenv/config";
import { defineConfig } from "prisma/config";
export default defineConfig({
schema: "prisma/schema.prisma",
migrations: {
path: "prisma/migrations",
},
datasource: {
url: process.env["DATABASE_URL"],
},
});

155
prisma/schema.prisma Normal file
View File

@@ -0,0 +1,155 @@
generator client {
provider = "prisma-client"
output = "../generated/prisma"
}
datasource db {
provider = "sqlite"
}
model Appeal {
approved Boolean?
ban_reason String
created_at DateTime @default(now())
id String @id @unique
learned String
reason_for_unban String
user Json
@@index([approved, created_at], name: "idx_appeals_approved_created_at")
@@map("appeals")
}
model AppealBan {
created_at DateTime @default(now())
created_by String
user String @id @unique
@@map("appeal_bans")
}
model EtMember {
created_at DateTime @default(now())
created_by String
id String @id @unique
is_management Boolean @default(false)
name String
points Int @default(0)
roblox_id Int?
@@index([id, name], name: "idx_et_members_id_name")
@@map("et_members")
}
model EtStrike {
created_at DateTime @default(now())
created_by String
id String @id @unique
reason String
user String
@@map("et_strikes")
}
model Event {
answer String?
answered_at DateTime?
approved Boolean @default(false)
created_at DateTime @default(now())
created_by String
day Int
details String
id String @id @unique
month Int
pending Boolean @default(true)
performed_at DateTime?
reached_minimum_player_count Boolean @default(false)
type String
year Int
@@index([month, year], name: "idx_events_month_year")
@@map("events")
}
model GameAppeal {
created_at DateTime @default(now())
id String @id @unique
reason_for_unban String
roblox_id Int
roblox_username String
type String
what_happened String
@@index([created_at], name: "idx_game_appeals_created_at")
@@map("game_appeals")
}
model GameModLog {
action String
evidence String
executed_at DateTime @default(now())
executor String
id String @id @unique
target Int
@@index([target], name: "idx_game_mod_logs_target")
@@map("game_mod_logs")
}
model GameModNote {
content String
created_at DateTime @default(now())
created_by String
id String @id @unique
target Int
@@index([target], name: "idx_game_mod_notes_target")
@@map("game_mod_notes")
}
model InactivityNotice {
created_at DateTime @default(now())
decisions Json
departments Json @default("[]")
end String
hiatus Boolean @default(false)
id String @id @unique
reason String
start String
user Json
@@index([end, start], name: "idx_inactivity_notices_end_start")
@@map("inactivity_notices")
}
model PushNotification {
created_at DateTime @default(now())
event_id String @unique
event_type String
token String
@@map("push_notifications")
}
model Report {
attachments Json @default("[]")
created_at DateTime @default(now())
id String @id @unique
open Boolean @default(true)
target_ids Json @default("[]")
target_usernames Json @default("[]")
type String @default("exploit")
user Json?
@@index([created_at, open], name: "idx_reports_created_at_open")
@@map("reports")
}
model ShortLink {
created_at DateTime @default(now())
destination String
path String @unique
user String
@@map("short_links")
}