From 4f0efb64545b2443b341b934dad9b4d934f40d7b Mon Sep 17 00:00:00 2001 From: Divya Pahuja Date: Tue, 10 Mar 2026 03:01:25 +0530 Subject: [PATCH] refactor: remove prisma and sqlite database files to transition to database-less architecture --- app/db.server.js | 11 ----- .../migration.sql | 20 --------- .../migration.sql | 9 ---- prisma/migrations/migration_lock.toml | 3 -- prisma/schema.prisma | 43 ------------------- 5 files changed, 86 deletions(-) delete mode 100644 app/db.server.js delete mode 100644 prisma/migrations/20240530213853_create_session_table/migration.sql delete mode 100644 prisma/migrations/20260303215954_add_review_model/migration.sql delete mode 100644 prisma/migrations/migration_lock.toml delete mode 100644 prisma/schema.prisma diff --git a/app/db.server.js b/app/db.server.js deleted file mode 100644 index a6206be..0000000 --- a/app/db.server.js +++ /dev/null @@ -1,11 +0,0 @@ -import { PrismaClient } from "@prisma/client"; - -if (process.env.NODE_ENV !== "production") { - if (!global.prismaGlobal) { - global.prismaGlobal = new PrismaClient(); - } -} - -const prisma = global.prismaGlobal ?? new PrismaClient(); - -export default prisma; diff --git a/prisma/migrations/20240530213853_create_session_table/migration.sql b/prisma/migrations/20240530213853_create_session_table/migration.sql deleted file mode 100644 index 3f8c675..0000000 --- a/prisma/migrations/20240530213853_create_session_table/migration.sql +++ /dev/null @@ -1,20 +0,0 @@ --- CreateTable -CREATE TABLE "Session" ( - "id" TEXT NOT NULL PRIMARY KEY, - "shop" TEXT NOT NULL, - "state" TEXT NOT NULL, - "isOnline" BOOLEAN NOT NULL DEFAULT false, - "scope" TEXT, - "expires" DATETIME, - "accessToken" TEXT NOT NULL, - "userId" BIGINT, - "firstName" TEXT, - "lastName" TEXT, - "email" TEXT, - "accountOwner" BOOLEAN NOT NULL DEFAULT false, - "locale" TEXT, - "collaborator" BOOLEAN DEFAULT false, - "emailVerified" BOOLEAN DEFAULT false, - "refreshToken" TEXT, - "refreshTokenExpires" DATETIME -); diff --git a/prisma/migrations/20260303215954_add_review_model/migration.sql b/prisma/migrations/20260303215954_add_review_model/migration.sql deleted file mode 100644 index 9b49a0b..0000000 --- a/prisma/migrations/20260303215954_add_review_model/migration.sql +++ /dev/null @@ -1,9 +0,0 @@ --- CreateTable -CREATE TABLE "Review" ( - "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, - "productId" TEXT NOT NULL, - "name" TEXT NOT NULL, - "review" TEXT NOT NULL, - "rating" INTEGER, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP -); diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml deleted file mode 100644 index 2a5a444..0000000 --- a/prisma/migrations/migration_lock.toml +++ /dev/null @@ -1,3 +0,0 @@ -# Please do not edit this file manually -# It should be added in your version-control system (e.g., Git) -provider = "sqlite" diff --git a/prisma/schema.prisma b/prisma/schema.prisma deleted file mode 100644 index 6d2714d..0000000 --- a/prisma/schema.prisma +++ /dev/null @@ -1,43 +0,0 @@ -// This is your Prisma schema file, -// learn more about it in the docs: https://pris.ly/d/prisma-schema - -generator client { - provider = "prisma-client-js" -} - -// Note that some adapters may set a maximum length for the String type by default, please ensure your strings are long -// enough when changing adapters. -// See https://www.prisma.io/docs/orm/reference/prisma-schema-reference#string for more information -datasource db { - provider = "sqlite" - url = "file:dev.sqlite" -} - -model Session { - id String @id - shop String - state String - isOnline Boolean @default(false) - scope String? - expires DateTime? - accessToken String - userId BigInt? - firstName String? - lastName String? - email String? - accountOwner Boolean @default(false) - locale String? - collaborator Boolean? @default(false) - emailVerified Boolean? @default(false) - refreshToken String? - refreshTokenExpires DateTime? -} - -model Review { - id Int @id @default(autoincrement()) - productId String - name String - review String - rating Int? - createdAt DateTime @default(now()) -} \ No newline at end of file