schema.prisma 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. fileId String?
  73. createdAt DateTime @default(now())
  74. updatedAt DateTime @updatedAt
  75. cintasSummaries CintasSummary[]
  76. cintasInstallCalendar CintasInstallCalendar[]
  77. @@map("imports")
  78. }
  79. model CintasSummary {
  80. id Int @id @default(autoincrement())
  81. importId Int
  82. import Import @relation(fields: [importId], references: [id], onDelete: Cascade)
  83. week String
  84. trrTotal Int
  85. fourWkAverages Int
  86. trrPlus4Wk Int
  87. powerAdds Int
  88. weekId Int
  89. createdAt DateTime @default(now())
  90. updatedAt DateTime @updatedAt
  91. @@map("cintas_intall_calendar_summary")
  92. }
  93. model CintasInstallCalendar {
  94. id Int @id @default(autoincrement())
  95. importId Int
  96. import Import @relation(fields: [importId], references: [id], onDelete: Cascade)
  97. opportunityStatus String? @map("opportunity_status") @db.VarChar(4000)
  98. week String? @db.VarChar(4000)
  99. qtr String? @db.VarChar(4000)
  100. installDate String? @map("install_date") @db.VarChar(4000)
  101. accountName String? @map("account_name") @db.VarChar(4000)
  102. zipCode String? @map("zip_code") @db.VarChar(4000)
  103. soldToNumber String? @map("sold_to_number") @db.VarChar(4000)
  104. sortNumber String? @map("sort_number") @db.VarChar(4000)
  105. type String? @db.VarChar(4000)
  106. route String? @db.VarChar(4000)
  107. day String? @db.VarChar(4000)
  108. trr String? @db.VarChar(4000)
  109. paperChemWk1 String? @map("paper_chem_wk1") @db.VarChar(4000)
  110. paperChemWk2 String? @map("paper_chem_wk2") @db.VarChar(4000)
  111. paperChemWk3 String? @map("paper_chem_wk3") @db.VarChar(4000)
  112. paperChemWk4 String? @map("paper_chem_wk4") @db.VarChar(4000)
  113. sanis String? @db.VarChar(4000)
  114. powerAdd String? @map("power_add") @db.VarChar(4000)
  115. createdAt DateTime @default(now())
  116. updatedAt DateTime @updatedAt
  117. @@map("cintas_install_calendar")
  118. }