From 3e75fb6ae24124697d7ec43d6fcfef8dd28def91 Mon Sep 17 00:00:00 2001 From: wilson Date: Sun, 15 Mar 2026 17:33:04 +0000 Subject: [PATCH] prisma: Update schema to add filenames --- generated/prisma/commonInputTypes.ts | 140 ++++++++++++++++++ generated/prisma/internal/class.ts | 8 +- generated/prisma/internal/prismaNamespace.ts | 20 ++- .../prisma/internal/prismaNamespaceBrowser.ts | 13 +- generated/prisma/models/PhotoPost.ts | 98 +++++++++++- .../migration.sql | 24 +++ .../migration.sql | 30 ++++ prisma/schema.prisma | 4 + 8 files changed, 328 insertions(+), 9 deletions(-) create mode 100644 prisma/migrations/20260313211532_add_fields_to_photo_stream/migration.sql create mode 100644 prisma/migrations/20260314083527_change_filepath_to_filename/migration.sql diff --git a/generated/prisma/commonInputTypes.ts b/generated/prisma/commonInputTypes.ts index df85a77..37f5cb5 100644 --- a/generated/prisma/commonInputTypes.ts +++ b/generated/prisma/commonInputTypes.ts @@ -36,6 +36,39 @@ export type DateTimeFilter<$PrismaModel = never> = { not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string } +export type StringFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] + notIn?: string[] + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringFilter<$PrismaModel> | string +} + +export type StringNullableFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | null + notIn?: string[] | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null +} + +export type SortOrderInput = { + sort: Prisma.SortOrder + nulls?: Prisma.NullsOrder +} + export type IntWithAggregatesFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> in?: number[] @@ -66,6 +99,40 @@ export type DateTimeWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedDateTimeFilter<$PrismaModel> } +export type StringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] + notIn?: string[] + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | null + notIn?: string[] | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedStringNullableFilter<$PrismaModel> + _max?: Prisma.NestedStringNullableFilter<$PrismaModel> +} + export type NestedIntFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> in?: number[] @@ -88,6 +155,34 @@ export type NestedDateTimeFilter<$PrismaModel = never> = { not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string } +export type NestedStringFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] + notIn?: string[] + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringFilter<$PrismaModel> | string +} + +export type NestedStringNullableFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | null + notIn?: string[] | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null +} + export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> in?: number[] @@ -129,4 +224,49 @@ export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedDateTimeFilter<$PrismaModel> } +export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] + notIn?: string[] + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | null + notIn?: string[] | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedStringNullableFilter<$PrismaModel> + _max?: Prisma.NestedStringNullableFilter<$PrismaModel> +} + +export type NestedIntNullableFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null + in?: number[] | null + notIn?: number[] | null + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null +} + diff --git a/generated/prisma/internal/class.ts b/generated/prisma/internal/class.ts index 367733f..1162790 100644 --- a/generated/prisma/internal/class.ts +++ b/generated/prisma/internal/class.ts @@ -20,7 +20,7 @@ const config: runtime.GetPrismaClientConfig = { "clientVersion": "7.4.2", "engineVersion": "94a226be1cf2967af2541cca5529f0f7ba866919", "activeProvider": "sqlite", - "inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"../generated/prisma\"\n}\n\ndatasource db {\n provider = \"sqlite\"\n}\n\nmodel PhotoPost {\n id Int @id @default(autoincrement())\n createdAt DateTime @default(now())\n}\n", + "inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"../generated/prisma\"\n}\n\ndatasource db {\n provider = \"sqlite\"\n}\n\nmodel PhotoPost {\n id Int @id @default(autoincrement())\n createdAt DateTime @default(now())\n fileName String @unique\n title String\n description String?\n}\n", "runtimeDataModel": { "models": {}, "enums": {}, @@ -32,10 +32,10 @@ const config: runtime.GetPrismaClientConfig = { } } -config.runtimeDataModel = JSON.parse("{\"models\":{\"PhotoPost\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}") +config.runtimeDataModel = JSON.parse("{\"models\":{\"PhotoPost\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"fileName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}") config.parameterizationSchema = { - strings: JSON.parse("[\"where\",\"PhotoPost.findUnique\",\"PhotoPost.findUniqueOrThrow\",\"orderBy\",\"cursor\",\"PhotoPost.findFirst\",\"PhotoPost.findFirstOrThrow\",\"PhotoPost.findMany\",\"data\",\"PhotoPost.createOne\",\"PhotoPost.createMany\",\"PhotoPost.createManyAndReturn\",\"PhotoPost.updateOne\",\"PhotoPost.updateMany\",\"PhotoPost.updateManyAndReturn\",\"create\",\"update\",\"PhotoPost.upsertOne\",\"PhotoPost.deleteOne\",\"PhotoPost.deleteMany\",\"having\",\"_count\",\"_avg\",\"_sum\",\"_min\",\"_max\",\"PhotoPost.groupBy\",\"PhotoPost.aggregate\",\"AND\",\"OR\",\"NOT\",\"id\",\"createdAt\",\"equals\",\"in\",\"notIn\",\"lt\",\"lte\",\"gt\",\"gte\",\"not\",\"set\",\"increment\",\"decrement\",\"multiply\",\"divide\"]"), - graph: "KwsQBRwAACIAMB0AAAQAEB4AACIAMB8CAAAAASBAACQAIQEAAAABACABAAAAAQAgBRwAACIAMB0AAAQAEB4AACIAMB8CACMAISBAACQAIQADAAAABAAgAwAABQAwBAAAAQAgAwAAAAQAIAMAAAUAMAQAAAEAIAMAAAAEACADAAAFADAEAAABACACHwIAAAABIEAAAAABAQgAAAkAIAIfAgAAAAEgQAAAAAEBCAAACwAwAQgAAAsAMAIfAgArACEgQAAqACECAAAAAQAgCAAADgAgAh8CACsAISBAACoAIQIAAAAEACAIAAAQACACAAAABAAgCAAAEAAgAwAAAAEAIA8AAAkAIBAAAA4AIAEAAAABACABAAAABAAgBRUAACUAIBYAACYAIBcAACkAIBgAACgAIBkAACcAIAUcAAAaADAdAAAXABAeAAAaADAfAgAbACEgQAAcACEDAAAABAAgAwAAFgAwFAAAFwAgAwAAAAQAIAMAAAUAMAQAAAEAIAUcAAAaADAdAAAXABAeAAAaADAfAgAbACEgQAAcACENFQAAHgAgFgAAIQAgFwAAHgAgGAAAHgAgGQAAHgAgIQIAAAABIgIAAAAEIwIAAAAEJAIAAAABJQIAAAABJgIAAAABJwIAAAABKAIAIAAhCxUAAB4AIBgAAB8AIBkAAB8AICFAAAAAASJAAAAABCNAAAAABCRAAAAAASVAAAAAASZAAAAAASdAAAAAAShAAB0AIQsVAAAeACAYAAAfACAZAAAfACAhQAAAAAEiQAAAAAQjQAAAAAQkQAAAAAElQAAAAAEmQAAAAAEnQAAAAAEoQAAdACEIIQIAAAABIgIAAAAEIwIAAAAEJAIAAAABJQIAAAABJgIAAAABJwIAAAABKAIAHgAhCCFAAAAAASJAAAAABCNAAAAABCRAAAAAASVAAAAAASZAAAAAASdAAAAAAShAAB8AIQ0VAAAeACAWAAAhACAXAAAeACAYAAAeACAZAAAeACAhAgAAAAEiAgAAAAQjAgAAAAQkAgAAAAElAgAAAAEmAgAAAAEnAgAAAAEoAgAgACEIIQgAAAABIggAAAAEIwgAAAAEJAgAAAABJQgAAAABJggAAAABJwgAAAABKAgAIQAhBRwAACIAMB0AAAQAEB4AACIAMB8CACMAISBAACQAIQghAgAAAAEiAgAAAAQjAgAAAAQkAgAAAAElAgAAAAEmAgAAAAEnAgAAAAEoAgAeACEIIUAAAAABIkAAAAAEI0AAAAAEJEAAAAABJUAAAAABJkAAAAABJ0AAAAABKEAAHwAhAAAAAAABKUAAAAABBSkCAAAAASoCAAAAASsCAAAAASwCAAAAAS0CAAAAAQAAAAAFFQAGFgAHFwAIGAAJGQAKAAAAAAAFFQAGFgAHFwAIGAAJGQAKAQIBAgMBBQYBBgcBBwgBCQoBCgwCCw0DDA8BDRECDhIEERMBEhQBExUCGhgFGxkL" + strings: JSON.parse("[\"where\",\"PhotoPost.findUnique\",\"PhotoPost.findUniqueOrThrow\",\"orderBy\",\"cursor\",\"PhotoPost.findFirst\",\"PhotoPost.findFirstOrThrow\",\"PhotoPost.findMany\",\"data\",\"PhotoPost.createOne\",\"PhotoPost.createMany\",\"PhotoPost.createManyAndReturn\",\"PhotoPost.updateOne\",\"PhotoPost.updateMany\",\"PhotoPost.updateManyAndReturn\",\"create\",\"update\",\"PhotoPost.upsertOne\",\"PhotoPost.deleteOne\",\"PhotoPost.deleteMany\",\"having\",\"_count\",\"_avg\",\"_sum\",\"_min\",\"_max\",\"PhotoPost.groupBy\",\"PhotoPost.aggregate\",\"AND\",\"OR\",\"NOT\",\"id\",\"createdAt\",\"fileName\",\"title\",\"description\",\"equals\",\"in\",\"notIn\",\"lt\",\"lte\",\"gt\",\"gte\",\"contains\",\"startsWith\",\"endsWith\",\"not\",\"set\",\"increment\",\"decrement\",\"multiply\",\"divide\"]"), + graph: "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" } async function decodeBase64AsWasm(wasmBase64: string): Promise { diff --git a/generated/prisma/internal/prismaNamespace.ts b/generated/prisma/internal/prismaNamespace.ts index 83115cd..3fff5fb 100644 --- a/generated/prisma/internal/prismaNamespace.ts +++ b/generated/prisma/internal/prismaNamespace.ts @@ -516,7 +516,10 @@ export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof export const PhotoPostScalarFieldEnum = { id: 'id', - createdAt: 'createdAt' + createdAt: 'createdAt', + fileName: 'fileName', + title: 'title', + description: 'description' } as const export type PhotoPostScalarFieldEnum = (typeof PhotoPostScalarFieldEnum)[keyof typeof PhotoPostScalarFieldEnum] @@ -530,6 +533,14 @@ export const SortOrder = { export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + + /** * Field references @@ -550,6 +561,13 @@ export type DateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel +/** + * Reference to a field of type 'String' + */ +export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String'> + + + /** * Reference to a field of type 'Float' */ diff --git a/generated/prisma/internal/prismaNamespaceBrowser.ts b/generated/prisma/internal/prismaNamespaceBrowser.ts index 21cca48..e564348 100644 --- a/generated/prisma/internal/prismaNamespaceBrowser.ts +++ b/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -69,7 +69,10 @@ export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof export const PhotoPostScalarFieldEnum = { id: 'id', - createdAt: 'createdAt' + createdAt: 'createdAt', + fileName: 'fileName', + title: 'title', + description: 'description' } as const export type PhotoPostScalarFieldEnum = (typeof PhotoPostScalarFieldEnum)[keyof typeof PhotoPostScalarFieldEnum] @@ -82,3 +85,11 @@ export const SortOrder = { export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + diff --git a/generated/prisma/models/PhotoPost.ts b/generated/prisma/models/PhotoPost.ts index 70dfd0e..2d1fc4e 100644 --- a/generated/prisma/models/PhotoPost.ts +++ b/generated/prisma/models/PhotoPost.ts @@ -37,16 +37,25 @@ export type PhotoPostSumAggregateOutputType = { export type PhotoPostMinAggregateOutputType = { id: number | null createdAt: Date | null + fileName: string | null + title: string | null + description: string | null } export type PhotoPostMaxAggregateOutputType = { id: number | null createdAt: Date | null + fileName: string | null + title: string | null + description: string | null } export type PhotoPostCountAggregateOutputType = { id: number createdAt: number + fileName: number + title: number + description: number _all: number } @@ -62,16 +71,25 @@ export type PhotoPostSumAggregateInputType = { export type PhotoPostMinAggregateInputType = { id?: true createdAt?: true + fileName?: true + title?: true + description?: true } export type PhotoPostMaxAggregateInputType = { id?: true createdAt?: true + fileName?: true + title?: true + description?: true } export type PhotoPostCountAggregateInputType = { id?: true createdAt?: true + fileName?: true + title?: true + description?: true _all?: true } @@ -164,6 +182,9 @@ export type PhotoPostGroupByArgs | number createdAt?: Prisma.DateTimeFilter<"PhotoPost"> | Date | string + fileName?: Prisma.StringFilter<"PhotoPost"> | string + title?: Prisma.StringFilter<"PhotoPost"> | string + description?: Prisma.StringNullableFilter<"PhotoPost"> | string | null } export type PhotoPostOrderByWithRelationInput = { id?: Prisma.SortOrder createdAt?: Prisma.SortOrder + fileName?: Prisma.SortOrder + title?: Prisma.SortOrder + description?: Prisma.SortOrderInput | Prisma.SortOrder } export type PhotoPostWhereUniqueInput = Prisma.AtLeast<{ id?: number + fileName?: string AND?: Prisma.PhotoPostWhereInput | Prisma.PhotoPostWhereInput[] OR?: Prisma.PhotoPostWhereInput[] NOT?: Prisma.PhotoPostWhereInput | Prisma.PhotoPostWhereInput[] createdAt?: Prisma.DateTimeFilter<"PhotoPost"> | Date | string -}, "id"> + title?: Prisma.StringFilter<"PhotoPost"> | string + description?: Prisma.StringNullableFilter<"PhotoPost"> | string | null +}, "id" | "fileName"> export type PhotoPostOrderByWithAggregationInput = { id?: Prisma.SortOrder createdAt?: Prisma.SortOrder + fileName?: Prisma.SortOrder + title?: Prisma.SortOrder + description?: Prisma.SortOrderInput | Prisma.SortOrder _count?: Prisma.PhotoPostCountOrderByAggregateInput _avg?: Prisma.PhotoPostAvgOrderByAggregateInput _max?: Prisma.PhotoPostMaxOrderByAggregateInput @@ -223,43 +256,70 @@ export type PhotoPostScalarWhereWithAggregatesInput = { NOT?: Prisma.PhotoPostScalarWhereWithAggregatesInput | Prisma.PhotoPostScalarWhereWithAggregatesInput[] id?: Prisma.IntWithAggregatesFilter<"PhotoPost"> | number createdAt?: Prisma.DateTimeWithAggregatesFilter<"PhotoPost"> | Date | string + fileName?: Prisma.StringWithAggregatesFilter<"PhotoPost"> | string + title?: Prisma.StringWithAggregatesFilter<"PhotoPost"> | string + description?: Prisma.StringNullableWithAggregatesFilter<"PhotoPost"> | string | null } export type PhotoPostCreateInput = { createdAt?: Date | string + fileName: string + title: string + description?: string | null } export type PhotoPostUncheckedCreateInput = { id?: number createdAt?: Date | string + fileName: string + title: string + description?: string | null } export type PhotoPostUpdateInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + fileName?: Prisma.StringFieldUpdateOperationsInput | string + title?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null } export type PhotoPostUncheckedUpdateInput = { id?: Prisma.IntFieldUpdateOperationsInput | number createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + fileName?: Prisma.StringFieldUpdateOperationsInput | string + title?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null } export type PhotoPostCreateManyInput = { id?: number createdAt?: Date | string + fileName: string + title: string + description?: string | null } export type PhotoPostUpdateManyMutationInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + fileName?: Prisma.StringFieldUpdateOperationsInput | string + title?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null } export type PhotoPostUncheckedUpdateManyInput = { id?: Prisma.IntFieldUpdateOperationsInput | number createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + fileName?: Prisma.StringFieldUpdateOperationsInput | string + title?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null } export type PhotoPostCountOrderByAggregateInput = { id?: Prisma.SortOrder createdAt?: Prisma.SortOrder + fileName?: Prisma.SortOrder + title?: Prisma.SortOrder + description?: Prisma.SortOrder } export type PhotoPostAvgOrderByAggregateInput = { @@ -269,11 +329,17 @@ export type PhotoPostAvgOrderByAggregateInput = { export type PhotoPostMaxOrderByAggregateInput = { id?: Prisma.SortOrder createdAt?: Prisma.SortOrder + fileName?: Prisma.SortOrder + title?: Prisma.SortOrder + description?: Prisma.SortOrder } export type PhotoPostMinOrderByAggregateInput = { id?: Prisma.SortOrder createdAt?: Prisma.SortOrder + fileName?: Prisma.SortOrder + title?: Prisma.SortOrder + description?: Prisma.SortOrder } export type PhotoPostSumOrderByAggregateInput = { @@ -284,6 +350,14 @@ export type DateTimeFieldUpdateOperationsInput = { set?: Date | string } +export type StringFieldUpdateOperationsInput = { + set?: string +} + +export type NullableStringFieldUpdateOperationsInput = { + set?: string | null +} + export type IntFieldUpdateOperationsInput = { set?: number increment?: number @@ -297,24 +371,36 @@ export type IntFieldUpdateOperationsInput = { export type PhotoPostSelect = runtime.Types.Extensions.GetSelect<{ id?: boolean createdAt?: boolean + fileName?: boolean + title?: boolean + description?: boolean }, ExtArgs["result"]["photoPost"]> export type PhotoPostSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ id?: boolean createdAt?: boolean + fileName?: boolean + title?: boolean + description?: boolean }, ExtArgs["result"]["photoPost"]> export type PhotoPostSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ id?: boolean createdAt?: boolean + fileName?: boolean + title?: boolean + description?: boolean }, ExtArgs["result"]["photoPost"]> export type PhotoPostSelectScalar = { id?: boolean createdAt?: boolean + fileName?: boolean + title?: boolean + description?: boolean } -export type PhotoPostOmit = runtime.Types.Extensions.GetOmit<"id" | "createdAt", ExtArgs["result"]["photoPost"]> +export type PhotoPostOmit = runtime.Types.Extensions.GetOmit<"id" | "createdAt" | "fileName" | "title" | "description", ExtArgs["result"]["photoPost"]> export type $PhotoPostPayload = { name: "PhotoPost" @@ -322,6 +408,9 @@ export type $PhotoPostPayload composites: {} } @@ -747,6 +836,9 @@ export interface Prisma__PhotoPostClient readonly createdAt: Prisma.FieldRef<"PhotoPost", 'DateTime'> + readonly fileName: Prisma.FieldRef<"PhotoPost", 'String'> + readonly title: Prisma.FieldRef<"PhotoPost", 'String'> + readonly description: Prisma.FieldRef<"PhotoPost", 'String'> } @@ -941,7 +1033,7 @@ export type PhotoPostCreateArgs + data: Prisma.XOR } /** diff --git a/prisma/migrations/20260313211532_add_fields_to_photo_stream/migration.sql b/prisma/migrations/20260313211532_add_fields_to_photo_stream/migration.sql new file mode 100644 index 0000000..0f36081 --- /dev/null +++ b/prisma/migrations/20260313211532_add_fields_to_photo_stream/migration.sql @@ -0,0 +1,24 @@ +/* + Warnings: + + - Added the required column `description` to the `PhotoPost` table without a default value. This is not possible if the table is not empty. + - Added the required column `filePath` to the `PhotoPost` table without a default value. This is not possible if the table is not empty. + - Added the required column `title` to the `PhotoPost` table without a default value. This is not possible if the table is not empty. + +*/ +-- RedefineTables +PRAGMA defer_foreign_keys=ON; +PRAGMA foreign_keys=OFF; +CREATE TABLE "new_PhotoPost" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "filePath" TEXT NOT NULL, + "title" TEXT NOT NULL, + "description" TEXT NOT NULL +); +INSERT INTO "new_PhotoPost" ("createdAt", "id") SELECT "createdAt", "id" FROM "PhotoPost"; +DROP TABLE "PhotoPost"; +ALTER TABLE "new_PhotoPost" RENAME TO "PhotoPost"; +CREATE UNIQUE INDEX "PhotoPost_filePath_key" ON "PhotoPost"("filePath"); +PRAGMA foreign_keys=ON; +PRAGMA defer_foreign_keys=OFF; diff --git a/prisma/migrations/20260314083527_change_filepath_to_filename/migration.sql b/prisma/migrations/20260314083527_change_filepath_to_filename/migration.sql new file mode 100644 index 0000000..39456a6 --- /dev/null +++ b/prisma/migrations/20260314083527_change_filepath_to_filename/migration.sql @@ -0,0 +1,30 @@ +/* + Warnings: + + - You are about to drop the column `filePath` on the `PhotoPost` table. All the data in the column will be lost. + - Added the required column `fileName` to the `PhotoPost` table without a default value. This is not possible if the table is not empty. + +*/ +-- RedefineTables +PRAGMA defer_foreign_keys=ON; +PRAGMA foreign_keys=OFF; +CREATE TABLE "new_PhotoPost" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "fileName" TEXT NOT NULL, + "title" TEXT NOT NULL, + "description" TEXT +); + +-- The filename field is the filepath, split by '/', and it's the last part, +-- so we need to modify the filePath column to fileName +ALTER TABLE "PhotoPost" ADD COLUMN "fileName" TEXT NOT NULL DEFAULT ''; +UPDATE "PhotoPost" SET "fileName" = SUBSTR("filePath", INSTR("filePath", '/') + 1); + +INSERT INTO "new_PhotoPost" ("createdAt", "description", "fileName", "id", "title") SELECT "createdAt", "description", "fileName", "id", "title" FROM "PhotoPost"; + +DROP TABLE "PhotoPost"; +ALTER TABLE "new_PhotoPost" RENAME TO "PhotoPost"; +CREATE UNIQUE INDEX "PhotoPost_fileName_key" ON "PhotoPost"("fileName"); +PRAGMA foreign_keys=ON; +PRAGMA defer_foreign_keys=OFF; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index cf82cbf..b1c18aa 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -10,4 +10,8 @@ datasource db { model PhotoPost { id Int @id @default(autoincrement()) createdAt DateTime @default(now()) + fileName String @unique + title String + description String? + }