@optimatech88/titomeet-shared-lib 1.0.31 → 1.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimatech88/titomeet-shared-lib",
3
- "version": "1.0.31",
3
+ "version": "1.0.32",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -0,0 +1,31 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `interests` on the `UserInterests` table. All the data in the column will be lost.
5
+
6
+ */
7
+ -- AlterTable
8
+ ALTER TABLE "EventCategory" ADD COLUMN "parentId" TEXT;
9
+
10
+ -- AlterTable
11
+ ALTER TABLE "UserInterests" DROP COLUMN "interests";
12
+
13
+ -- CreateTable
14
+ CREATE TABLE "_EventCategoryToUserInterests" (
15
+ "A" TEXT NOT NULL,
16
+ "B" TEXT NOT NULL,
17
+
18
+ CONSTRAINT "_EventCategoryToUserInterests_AB_pkey" PRIMARY KEY ("A","B")
19
+ );
20
+
21
+ -- CreateIndex
22
+ CREATE INDEX "_EventCategoryToUserInterests_B_index" ON "_EventCategoryToUserInterests"("B");
23
+
24
+ -- AddForeignKey
25
+ ALTER TABLE "EventCategory" ADD CONSTRAINT "EventCategory_parentId_fkey" FOREIGN KEY ("parentId") REFERENCES "EventCategory"("id") ON DELETE SET NULL ON UPDATE CASCADE;
26
+
27
+ -- AddForeignKey
28
+ ALTER TABLE "_EventCategoryToUserInterests" ADD CONSTRAINT "_EventCategoryToUserInterests_A_fkey" FOREIGN KEY ("A") REFERENCES "EventCategory"("id") ON DELETE CASCADE ON UPDATE CASCADE;
29
+
30
+ -- AddForeignKey
31
+ ALTER TABLE "_EventCategoryToUserInterests" ADD CONSTRAINT "_EventCategoryToUserInterests_B_fkey" FOREIGN KEY ("B") REFERENCES "UserInterests"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -68,6 +68,13 @@ model EventCategory {
68
68
  updatedAt DateTime @updatedAt
69
69
  active Boolean @default(true)
70
70
  events Event[] @relation("EventToEventCategory")
71
+ userInterests UserInterests[]
72
+
73
+ parentId String?
74
+ parent EventCategory? @relation("EventCategoryParent", fields: [parentId], references: [id])
75
+
76
+
77
+ children EventCategory[] @relation("EventCategoryParent")
71
78
  }
72
79
 
73
80
  model Event {
@@ -246,7 +253,8 @@ model OrderItem {
246
253
  model UserInterests {
247
254
  id String @id @default(cuid())
248
255
 
249
- interests String[]
256
+ interests EventCategory[]
257
+
250
258
  userId String @unique
251
259
  user User @relation(fields: [userId], references: [id])
252
260