schema.prisma 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // This is your Prisma schema file,
  2. // learn more about it in the docs: https://pris.ly/d/prisma-schema
  3. generator client {
  4. provider = "prisma-client-js"
  5. }
  6. datasource db {
  7. provider = "postgresql"
  8. url = env("DATABASE_URL")
  9. }
  10. model File {
  11. id String @id @default(cuid())
  12. filename String
  13. mimetype String
  14. size Int
  15. data Bytes // PostgreSQL ByteA type for blob storage
  16. createdAt DateTime @default(now())
  17. updatedAt DateTime @updatedAt
  18. }
  19. model User {
  20. id Int @id @default(autoincrement())
  21. name String
  22. username String
  23. email String
  24. createdAt DateTime @default(now())
  25. updatedAt DateTime @updatedAt
  26. @@map("users")
  27. }
  28. model LayoutConfiguration {
  29. id Int @id @default(autoincrement())
  30. name String
  31. sections LayoutSection[]
  32. createdAt DateTime @default(now())
  33. updatedAt DateTime @updatedAt
  34. @@map("layout_configurations")
  35. }
  36. model LayoutSection {
  37. id Int @id @default(autoincrement())
  38. configurationId Int
  39. name String
  40. type String
  41. sheetName String
  42. startingRow Int?
  43. endingRow Int?
  44. tableName String
  45. fields LayoutSectionField[]
  46. layoutConfiguration LayoutConfiguration @relation(fields: [configurationId], references: [id], onDelete: Cascade)
  47. createdAt DateTime @default(now())
  48. updatedAt DateTime @updatedAt
  49. @@map("layout_sections")
  50. }
  51. model LayoutSectionField {
  52. id Int @id @default(autoincrement())
  53. layoutSectionId Int
  54. cellPosition String
  55. name String
  56. dataType String
  57. dataTypeFormat String?
  58. importTableColumnName String
  59. importColumnOrderNumber Int
  60. layoutSection LayoutSection @relation(fields: [layoutSectionId], references: [id], onDelete: Cascade)
  61. createdAt DateTime @default(now())
  62. updatedAt DateTime @updatedAt
  63. @@map("layout_section_fields")
  64. }