From a9eb2ab65c23c773b9bebb26fb3ad7b50216ee2a Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Thu, 6 Feb 2025 09:29:38 -0500 Subject: [PATCH 1/4] add resident table --- .../20250206142847_add_residents/migration.sql | 14 ++++++++++++++ prisma/migrations/migration_lock.toml | 2 +- prisma/schema.prisma | 13 +++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 prisma/migrations/20250206142847_add_residents/migration.sql diff --git a/prisma/migrations/20250206142847_add_residents/migration.sql b/prisma/migrations/20250206142847_add_residents/migration.sql new file mode 100644 index 0000000..ed6192f --- /dev/null +++ b/prisma/migrations/20250206142847_add_residents/migration.sql @@ -0,0 +1,14 @@ +-- CreateTable +CREATE TABLE "Resident" ( + "id" TEXT NOT NULL, + "tenantId" TEXT NOT NULL, + "name" TEXT NOT NULL, + "phoneNumber" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Resident_pkey" PRIMARY KEY ("id") +); + +-- AddForeignKey +ALTER TABLE "Resident" ADD CONSTRAINT "Resident_tenantId_fkey" FOREIGN KEY ("tenantId") REFERENCES "Tenant"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml index fbffa92..648c57f 100644 --- a/prisma/migrations/migration_lock.toml +++ b/prisma/migrations/migration_lock.toml @@ -1,3 +1,3 @@ # Please do not edit this file manually -# It should be added in your version-control system (i.e. Git) +# It should be added in your version-control system (e.g., Git) provider = "postgresql" \ No newline at end of file diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 68d49c9..4adba1e 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -31,11 +31,24 @@ model User { @@unique([clerkId, tenantId]) } +model Resident { + id String @id @default(uuid()) + tenant Tenant @relation(fields: [tenantId], references: [id]) + tenantId String + + name String + phoneNumber String + + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt +} + model Tenant { id String @id @default(uuid()) clerkOrganizationId String @unique users User[] + residents Resident[] tenantConfig TenantConfig? name String -- 2.45.3 From 624413cf715ebc5709c2a836e53aab17bc916ed0 Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Thu, 6 Feb 2025 09:29:55 -0500 Subject: [PATCH 2/4] update prisma --- bun.lock | 18 +++++++++--------- package.json | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bun.lock b/bun.lock index 66a8fac..9cd43b1 100644 --- a/bun.lock +++ b/bun.lock @@ -9,7 +9,7 @@ "@inlang/paraglide-sveltekit": "^0.15.0", "@pothos/core": "^4.3.0", "@pothos/plugin-prisma": "^4.4.0", - "@prisma/client": "6.0.1", + "@prisma/client": "^6.3.1", "@tailwindcss/typography": "^0.5.15", "clerk-sveltekit": "https://pkg.pr.new/wobsoriano/clerk-sveltekit@ca15d4e", "clsx": "^2.1.1", @@ -52,7 +52,7 @@ "prettier": "^3.3.2", "prettier-plugin-svelte": "^3.2.6", "prettier-plugin-tailwindcss": "^0.6.5", - "prisma": "6.0.1", + "prisma": "^6.3.1", "storybook": "^8.5.0", "svelte": "^5.0.0", "svelte-check": "^4.0.0", @@ -309,19 +309,19 @@ "@pothos/plugin-prisma": ["@pothos/plugin-prisma@4.4.0", "", { "dependencies": { "@prisma/generator-helper": "^6.0.0" }, "peerDependencies": { "@pothos/core": "*", "@prisma/client": "*", "graphql": ">=16.6.0", "typescript": ">=4.7.2" }, "bin": { "prisma-pothos-types": "bin/generator.js" } }, "sha512-TlXJ8QVOihpPbJGGHwOv2MUFv61xHU2xgGyTVp7KWNLQ6hzP9RH3nSQY7H1pNLOYR5wK+RyREJcaswVNwtxuqw=="], - "@prisma/client": ["@prisma/client@6.0.1", "", { "peerDependencies": { "prisma": "*" }, "optionalPeers": ["prisma"] }, "sha512-60w7kL6bUxz7M6Gs/V+OWMhwy94FshpngVmOY05TmGD0Lhk+Ac0ZgtjlL6Wll9TD4G03t4Sq1wZekNVy+Xdlbg=="], + "@prisma/client": ["@prisma/client@6.3.1", "", { "peerDependencies": { "prisma": "*", "typescript": ">=5.1.0" }, "optionalPeers": ["prisma", "typescript"] }, "sha512-ARAJaPs+eBkemdky/XU3cvGRl+mIPHCN2lCXsl5Vlb0E2gV+R6IN7aCI8CisRGszEZondwIsW9Iz8EJkTdykyA=="], - "@prisma/debug": ["@prisma/debug@6.0.1", "", {}, "sha512-jQylgSOf7ibTVxqBacnAlVGvek6fQxJIYCQOeX2KexsfypNzXjJQSS2o5s+Mjj2Np93iSOQUaw6TvPj8syhG4w=="], + "@prisma/debug": ["@prisma/debug@6.3.1", "", {}, "sha512-RrEBkd+HLZx+ydfmYT0jUj7wjLiS95wfTOSQ+8FQbvb6vHh5AeKfEPt/XUQ5+Buljj8hltEfOslEW57/wQIVeA=="], - "@prisma/engines": ["@prisma/engines@6.0.1", "", { "dependencies": { "@prisma/debug": "6.0.1", "@prisma/engines-version": "5.23.0-27.5dbef10bdbfb579e07d35cc85fb1518d357cb99e", "@prisma/fetch-engine": "6.0.1", "@prisma/get-platform": "6.0.1" } }, "sha512-4hxzI+YQIR2uuDyVsDooFZGu5AtixbvM2psp+iayDZ4hRrAHo/YwgA17N23UWq7G6gRu18NvuNMb48qjP3DPQw=="], + "@prisma/engines": ["@prisma/engines@6.3.1", "", { "dependencies": { "@prisma/debug": "6.3.1", "@prisma/engines-version": "6.3.0-17.acc0b9dd43eb689cbd20c9470515d719db10d0b0", "@prisma/fetch-engine": "6.3.1", "@prisma/get-platform": "6.3.1" } }, "sha512-sXdqEVLyGAJ5/iUoG/Ea5AdHMN71m6PzMBWRQnLmhhOejzqAaEr8rUd623ql6OJpED4s/U4vIn4dg1qkF7vGag=="], - "@prisma/engines-version": ["@prisma/engines-version@5.23.0-27.5dbef10bdbfb579e07d35cc85fb1518d357cb99e", "", {}, "sha512-JmIds0Q2/vsOmnuTJYxY4LE+sajqjYKhLtdOT6y4imojqv5d/aeVEfbBGC74t8Be1uSp0OP8lxIj2OqoKbLsfQ=="], + "@prisma/engines-version": ["@prisma/engines-version@6.3.0-17.acc0b9dd43eb689cbd20c9470515d719db10d0b0", "", {}, "sha512-R/ZcMuaWZT2UBmgX3Ko6PAV3f8//ZzsjRIG1eKqp3f2rqEqVtCv+mtzuH2rBPUC9ujJ5kCb9wwpxeyCkLcHVyA=="], - "@prisma/fetch-engine": ["@prisma/fetch-engine@6.0.1", "", { "dependencies": { "@prisma/debug": "6.0.1", "@prisma/engines-version": "5.23.0-27.5dbef10bdbfb579e07d35cc85fb1518d357cb99e", "@prisma/get-platform": "6.0.1" } }, "sha512-T36bWFVGeGYYSyYOj9d+O9G3sBC+pAyMC+jc45iSL63/Haq1GrYjQPgPMxrEj9m739taXrupoysRedQ+VyvM/Q=="], + "@prisma/fetch-engine": ["@prisma/fetch-engine@6.3.1", "", { "dependencies": { "@prisma/debug": "6.3.1", "@prisma/engines-version": "6.3.0-17.acc0b9dd43eb689cbd20c9470515d719db10d0b0", "@prisma/get-platform": "6.3.1" } }, "sha512-HOf/0umOgt+/S2xtZze+FHKoxpVg4YpVxROr6g2YG09VsI3Ipyb+rGvD6QGbCqkq5NTWAAZoOGNL+oy7t+IhaQ=="], "@prisma/generator-helper": ["@prisma/generator-helper@6.2.1", "", { "dependencies": { "@prisma/debug": "6.2.1" } }, "sha512-7Ws8DCXGan7hhaFMERXYdmhsudvSzEsrTttJEC7ubZJidvyimS12m3xpM+dLTt+NAShJ7Op7PgF+Mal2jf6xfg=="], - "@prisma/get-platform": ["@prisma/get-platform@6.0.1", "", { "dependencies": { "@prisma/debug": "6.0.1" } }, "sha512-zspC9vlxAqx4E6epMPMLLBMED2VD8axDe8sPnquZ8GOsn6tiacWK0oxrGK4UAHYzYUVuMVUApJbdXB2dFpLhvg=="], + "@prisma/get-platform": ["@prisma/get-platform@6.3.1", "", { "dependencies": { "@prisma/debug": "6.3.1" } }, "sha512-AYLq6Hk9xG73JdLWJ3Ip9Wg/vlP7xPvftGBalsPzKDOHr/ImhwJ09eS8xC2vNT12DlzGxhfk8BkL0ve2OriNhQ=="], "@repeaterjs/repeater": ["@repeaterjs/repeater@3.0.6", "", {}, "sha512-Javneu5lsuhwNCryN+pXH93VPQ8g0dBX7wItHFgYiwQmzE1sVdg5tWHiOgHywzL2W21XQopa7IwIEnNbmeUJYA=="], @@ -1249,7 +1249,7 @@ "pretty-format": ["pretty-format@27.5.1", "", { "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", "react-is": "^17.0.1" } }, "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ=="], - "prisma": ["prisma@6.0.1", "", { "dependencies": { "@prisma/engines": "6.0.1" }, "optionalDependencies": { "fsevents": "2.3.3" }, "bin": { "prisma": "build/index.js" } }, "sha512-CaMNFHkf+DDq8zq3X/JJsQ4Koy7dyWwwtOKibkT/Am9j/tDxcfbg7+lB1Dzhx18G/+RQCMgjPYB61bhRqteNBQ=="], + "prisma": ["prisma@6.3.1", "", { "dependencies": { "@prisma/engines": "6.3.1" }, "optionalDependencies": { "fsevents": "2.3.3" }, "peerDependencies": { "typescript": ">=5.1.0" }, "optionalPeers": ["typescript"], "bin": { "prisma": "build/index.js" } }, "sha512-JKCZWvBC3enxk51tY4TWzS4b5iRt4sSU1uHn2I183giZTvonXaQonzVtjLzpOHE7qu9MxY510kAtFGJwryKe3Q=="], "process": ["process@0.11.10", "", {}, "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A=="], diff --git a/package.json b/package.json index 68db3cb..8e7c8df 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "prettier": "^3.3.2", "prettier-plugin-svelte": "^3.2.6", "prettier-plugin-tailwindcss": "^0.6.5", - "prisma": "6.0.1", + "prisma": "6.3.1", "storybook": "^8.5.0", "svelte": "^5.0.0", "svelte-check": "^4.0.0", @@ -73,7 +73,7 @@ "@inlang/paraglide-sveltekit": "^0.15.0", "@pothos/core": "^4.3.0", "@pothos/plugin-prisma": "^4.4.0", - "@prisma/client": "6.0.1", + "@prisma/client": "6.3.1", "@tailwindcss/typography": "^0.5.15", "clerk-sveltekit": "https://pkg.pr.new/wobsoriano/clerk-sveltekit@ca15d4e", "clsx": "^2.1.1", -- 2.45.3 From 8e74f36324144fbdbe42fb415b3ff6c7453bfa0c Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Fri, 7 Feb 2025 16:01:51 -0500 Subject: [PATCH 3/4] toc --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 562f3f5..df9bed1 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,16 @@ # Hestia -Hestia is an early stage project + -- [Setup](#setup) -- [Developing](#developing) - - [Modifying Database Schema](#modifying-database-schema) -- [Building](#building) -- [Stack](#stack) +- [Hestia](#hestia) + - [Setup](#setup) + - [Developing](#developing) + - [Modifying Database Schema](#modifying-database-schema) + - [Building](#building) + - [Stack](#stack) - [Frontend](#frontend) - [Backend](#backend) - [Tools](#tools) + + +Hestia is an early stage project ## Setup -- 2.45.3 From 513cbee8e8262c6758adb9f202f393f0030dc926 Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Fri, 7 Feb 2025 16:24:22 -0500 Subject: [PATCH 4/4] ignore md --- .prettierignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.prettierignore b/.prettierignore index ab78a95..13605c0 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,3 +2,4 @@ package-lock.json pnpm-lock.yaml yarn.lock +*.md \ No newline at end of file -- 2.45.3