schema.prisma 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. imports Import[]
  33. createdAt DateTime @default(now())
  34. updatedAt DateTime @updatedAt
  35. @@map("layout_configurations")
  36. }
  37. model LayoutSection {
  38. id Int @id @default(autoincrement())
  39. configurationId Int
  40. name String
  41. type String
  42. sheetName String
  43. startingRow Int?
  44. endingRow Int?
  45. tableName String
  46. fields LayoutSectionField[]
  47. layoutConfiguration LayoutConfiguration @relation(fields: [configurationId], references: [id], onDelete: Cascade)
  48. createdAt DateTime @default(now())
  49. updatedAt DateTime @updatedAt
  50. @@map("layout_sections")
  51. }
  52. model LayoutSectionField {
  53. id Int @id @default(autoincrement())
  54. layoutSectionId Int
  55. cellPosition String
  56. name String
  57. dataType String
  58. dataTypeFormat String?
  59. importTableColumnName String
  60. importColumnOrderNumber Int
  61. layoutSection LayoutSection @relation(fields: [layoutSectionId], references: [id], onDelete: Cascade)
  62. createdAt DateTime @default(now())
  63. updatedAt DateTime @updatedAt
  64. @@map("layout_section_fields")
  65. }
  66. model Import {
  67. id Int @id @default(autoincrement())
  68. name String
  69. importDate DateTime @default(now())
  70. layoutId Int
  71. layout LayoutConfiguration @relation(fields: [layoutId], references: [id])
  72. createdAt DateTime @default(now())
  73. updatedAt DateTime @updatedAt
  74. cintasSummaries CintasSummary[]
  75. @@map("imports")
  76. }
  77. model CintasSummary {
  78. id Int @id @default(autoincrement())
  79. importId Int
  80. import Import @relation(fields: [importId], references: [id], onDelete: Cascade)
  81. week String
  82. trrTotal Int
  83. fourWkAverages Int
  84. trrPlus4Wk Int
  85. powerAdds Int
  86. weekId Int
  87. createdAt DateTime @default(now())
  88. updatedAt DateTime @updatedAt
  89. @@map("cintas_intall_calendar_summary")
  90. }