mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Make Project description field non-nullable (#483)
Co-Authored-By: Konstantin Wohlwend <n2d4xc@gmail.com>
This commit is contained in:
parent
0def869ee7
commit
46f388342e
@ -0,0 +1,11 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- Made the column `description` on table `Project` required. This step will fail if there are existing NULL values in that column.
|
||||
|
||||
*/
|
||||
-- First, update any null descriptions to empty string
|
||||
UPDATE "Project" SET "description" = '' WHERE "description" IS NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Project" ALTER COLUMN "description" SET NOT NULL;
|
||||
@ -17,7 +17,7 @@ model Project {
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
displayName String
|
||||
description String? @default("")
|
||||
description String @default("")
|
||||
configId String @db.Uuid
|
||||
config ProjectConfig @relation(fields: [configId], references: [id], onDelete: Cascade)
|
||||
isProductionMode Boolean
|
||||
|
||||
@ -449,7 +449,7 @@ export const projectsCrudHandlers = createLazyProxy(() => createCrudHandlers(pro
|
||||
where: { id: auth.project.id },
|
||||
data: {
|
||||
displayName: data.display_name,
|
||||
description: data.description,
|
||||
description: data.description ?? "",
|
||||
isProductionMode: data.is_production_mode,
|
||||
config: {
|
||||
update: {
|
||||
|
||||
@ -116,7 +116,7 @@ export function projectPrismaToCrud(
|
||||
return {
|
||||
id: prisma.id,
|
||||
display_name: prisma.displayName,
|
||||
description: prisma.description ?? "",
|
||||
description: prisma.description,
|
||||
created_at_millis: prisma.createdAt.getTime(),
|
||||
user_count: prisma._count.projectUsers,
|
||||
is_production_mode: prisma.isProductionMode,
|
||||
@ -504,7 +504,7 @@ export async function createProject(ownerIds: string[], data: InternalProjectsCr
|
||||
data: {
|
||||
id: generateUuid(),
|
||||
displayName: data.display_name,
|
||||
description: data.description,
|
||||
description: data.description ?? "",
|
||||
isProductionMode: data.is_production_mode ?? false,
|
||||
config: {
|
||||
create: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user