diff --git a/app/composables/useCategories.ts b/app/composables/useCategories.ts new file mode 100644 index 0000000..e69de29 diff --git a/app/composables/useGalleries.ts b/app/composables/useGalleries.ts new file mode 100644 index 0000000..e69de29 diff --git a/prisma/schema.prisma b/prisma/schema.prisma index ef17db5..0703e2d 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -55,6 +55,26 @@ model User { tokens Token[] } +model Category { + id Int @id @default(autoincrement()) + createdAt DateTime @default(now()) + updatedAt DateTime @default(now()) @updatedAt + + name String + galleries Gallery[] +} + +model Gallery { + id Int @id @default(autoincrement()) + createdAt DateTime @default(now()) + updatedAt DateTime @default(now()) @updatedAt + + name String + medias Media[] + Category Category? @relation(fields: [categoryId], references: [id]) + categoryId Int? +} + model Media { id Int @id @default(autoincrement()) createdAt DateTime @default(now()) @@ -63,8 +83,10 @@ model Media { fileName String url String directory String - pseudoDirectory String @default("/") - isFolder Boolean @default(false) + pseudoDirectory String @default("/") + isFolder Boolean @default(false) + Gallery Gallery? @relation(fields: [galleryId], references: [id]) + galleryId Int? } model Token {