mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
Implement requests page
This commit is contained in:
parent
75eaf17346
commit
d3439321ba
14 changed files with 10333 additions and 7522 deletions
|
|
@ -5,7 +5,7 @@ const LIMIT_PENDING = 5
|
|||
|
||||
export default async function MigrationFn(tx: Prisma.TransactionClient) {
|
||||
const donatorRequests = await tx.requests.findMany({
|
||||
where: { donator: true, state: RequestState.PENDING, userID: { not: null } }
|
||||
where: { donator: true, state: RequestState.PENDING }
|
||||
})
|
||||
const donatorMap = new Map<string, typeof donatorRequests>()
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `user` on the `requests` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `createdAt` on the `roles` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `updatedAt` on the `roles` table. All the data in the column will be lost.
|
||||
- Made the column `userID` on table `requests` required. This step will fail if there are existing NULL values in that column.
|
||||
|
||||
*/
|
||||
|
||||
DELETE FROM `requests` WHERE `userId` IS NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `requests` DROP COLUMN `user`,
|
||||
MODIFY `userID` VARCHAR(255) NOT NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `roles` DROP COLUMN `createdAt`,
|
||||
DROP COLUMN `updatedAt`;
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
# Please do not edit this file manually
|
||||
# It should be added in your version-control system (e.g., Git)
|
||||
provider = "mysql"
|
||||
provider = "mysql"
|
||||
|
|
|
|||
|
|
@ -344,8 +344,7 @@ model requests {
|
|||
id Int @id @default(autoincrement())
|
||||
title String? @db.VarChar(255)
|
||||
link String? @db.VarChar(255)
|
||||
user String? @db.VarChar(255)
|
||||
userID String? @db.VarChar(255)
|
||||
userID String @db.VarChar(255)
|
||||
state RequestState
|
||||
donator Boolean
|
||||
reason String? @db.VarChar(255)
|
||||
|
|
@ -359,8 +358,6 @@ model requests {
|
|||
model roles {
|
||||
name String @id @db.VarChar(255)
|
||||
permissions Json?
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
users User_Role[]
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue