schema.prisma 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. userId String? // Kinde user ID that uploaded the file
  17. createdAt DateTime @default(now())
  18. updatedAt DateTime @updatedAt
  19. }
  20. model User {
  21. id Int @id @default(autoincrement())
  22. name String
  23. username String
  24. email String
  25. createdAt DateTime @default(now())
  26. updatedAt DateTime @updatedAt
  27. @@map("users")
  28. }
  29. model LayoutConfiguration {
  30. id Int @id @default(autoincrement())
  31. name String
  32. sections LayoutSection[]
  33. imports Import[]
  34. createdAt DateTime @default(now())
  35. updatedAt DateTime @updatedAt
  36. @@map("layout_configurations")
  37. }
  38. model LayoutSection {
  39. id Int @id @default(autoincrement())
  40. configurationId Int
  41. name String
  42. type String
  43. sheetName String
  44. startingRow Int?
  45. endingRow Int?
  46. tableName String
  47. fields LayoutSectionField[]
  48. layoutConfiguration LayoutConfiguration @relation(fields: [configurationId], references: [id], onDelete: Cascade)
  49. createdAt DateTime @default(now())
  50. updatedAt DateTime @updatedAt
  51. @@map("layout_sections")
  52. }
  53. model LayoutSectionField {
  54. id Int @id @default(autoincrement())
  55. layoutSectionId Int
  56. cellPosition String
  57. name String
  58. dataType String
  59. dataTypeFormat String?
  60. importTableColumnName String
  61. importColumnOrderNumber Int
  62. layoutSection LayoutSection @relation(fields: [layoutSectionId], references: [id], onDelete: Cascade)
  63. createdAt DateTime @default(now())
  64. updatedAt DateTime @updatedAt
  65. @@map("layout_section_fields")
  66. }
  67. model Import {
  68. id Int @id @default(autoincrement())
  69. name String
  70. importDate DateTime @default(now())
  71. layoutId Int
  72. layout LayoutConfiguration @relation(fields: [layoutId], references: [id])
  73. fileId String?
  74. createdAt DateTime @default(now())
  75. updatedAt DateTime @updatedAt
  76. cintasSummaries CintasSummary[]
  77. cintasInstallCalendar CintasInstallCalendar[]
  78. @@map("imports")
  79. }
  80. model CintasSummary {
  81. id Int @id @default(autoincrement())
  82. importId Int
  83. import Import @relation(fields: [importId], references: [id], onDelete: Cascade)
  84. week String
  85. trrTotal Int
  86. fourWkAverages Int
  87. trrPlus4Wk Int
  88. powerAdds Int
  89. weekId Int
  90. createdAt DateTime @default(now())
  91. updatedAt DateTime @updatedAt
  92. @@map("cintas_intall_calendar_summary")
  93. }
  94. model CintasInstallCalendar {
  95. id Int @id @default(autoincrement())
  96. importId Int
  97. import Import @relation(fields: [importId], references: [id], onDelete: Cascade)
  98. opportunityStatus String? @map("opportunity_status") @db.VarChar(4000)
  99. week String? @db.VarChar(4000)
  100. qtr String? @db.VarChar(4000)
  101. installDate String? @map("install_date") @db.VarChar(4000)
  102. accountName String? @map("account_name") @db.VarChar(4000)
  103. zipCode String? @map("zip_code") @db.VarChar(4000)
  104. soldToNumber String? @map("sold_to_number") @db.VarChar(4000)
  105. sortNumber String? @map("sort_number") @db.VarChar(4000)
  106. type String? @db.VarChar(4000)
  107. route String? @db.VarChar(4000)
  108. day String? @db.VarChar(4000)
  109. trr String? @db.VarChar(4000)
  110. paperChemWk1 String? @map("paper_chem_wk1") @db.VarChar(4000)
  111. paperChemWk2 String? @map("paper_chem_wk2") @db.VarChar(4000)
  112. paperChemWk3 String? @map("paper_chem_wk3") @db.VarChar(4000)
  113. paperChemWk4 String? @map("paper_chem_wk4") @db.VarChar(4000)
  114. sanis String? @db.VarChar(4000)
  115. powerAdd String? @map("power_add") @db.VarChar(4000)
  116. createdAt DateTime @default(now())
  117. updatedAt DateTime @updatedAt
  118. @@map("cintas_install_calendar")
  119. }
  120. model SiteInformation {
  121. id Int @id @default(autoincrement())
  122. companyName String @map("company_name") @db.VarChar(1000)
  123. phoneNumber String @map("phone_number") @db.VarChar(1000)
  124. facilityName String @map("facility_name") @db.VarChar(1000)
  125. companyContact String @map("company_contact") @db.VarChar(1000)
  126. createdAt DateTime @default(now())
  127. updatedAt DateTime @updatedAt
  128. @@map("siteinfo_siteinformation")
  129. }