diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 9b88914d9..d74bb99f8 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -43,7 +43,7 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push + - name: Build and push sqlite uses: docker/build-push-action@v6 with: context: . @@ -53,3 +53,15 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max + + - name: Build and push postgresql + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: postgresql-${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: "DB_DATASOURCE=postgresql" + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.gitignore b/.gitignore index b671c94b9..763df5bd4 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,8 @@ yarn-error.log* # env file .env -!/backend/prisma/.env +!/backend/prisma/sqlite/.env +!/backend/prisma/postgresql/.env # vercel .vercel diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1d47183f2..978eadbd4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -73,8 +73,8 @@ The backend is built with [Nest.js](https://nestjs.com) and uses Typescript. 1. Open the `backend` folder 2. Install the dependencies with `npm install` -3. Push the database schema to the database by running `npx prisma db push` -4. Seed the database with `npx prisma db seed` +3. Push the database schema to the database by running `npx prisma db push --schema=prisma/sqlite/schema/` +4. Seed the database with `npx prisma db seed --schema=prisma/sqlite/schema/` 5. Start the backend with `npm run dev` ### Frontend diff --git a/Dockerfile b/Dockerfile index e6e4baff4..c243f3caf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,35 +1,40 @@ -# Stage 1: Frontend dependencies -FROM node:22-alpine AS frontend-dependencies +ARG NODE_VERSION="22" +ARG ALPINE_VERSION="" + +# Preamble: define base image used by all stages +FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} AS base WORKDIR /opt/app + +# Stage 1: Frontend dependencies +FROM base AS frontend-dependencies COPY frontend/package.json frontend/package-lock.json ./ RUN npm ci # Stage 2: Build frontend -FROM node:22-alpine AS frontend-builder -WORKDIR /opt/app +FROM base AS frontend-builder COPY ./frontend . COPY --from=frontend-dependencies /opt/app/node_modules ./node_modules RUN npm run build # Stage 3: Backend dependencies -FROM node:22-alpine AS backend-dependencies +FROM base AS backend-dependencies RUN apk add --no-cache python3 -WORKDIR /opt/app COPY backend/package.json backend/package-lock.json ./ RUN npm ci # Stage 4: Build backend -FROM node:22-alpine AS backend-builder +FROM base AS backend-builder +ARG DB_DATASOURCE=sqlite + RUN apk add openssl -WORKDIR /opt/app COPY ./backend . COPY --from=backend-dependencies /opt/app/node_modules ./node_modules -RUN npx prisma generate +RUN npx prisma generate --schema=prisma/${DB_DATASOURCE}/schema/ RUN npm run build && npm prune --production # Stage 5: Final image -FROM node:22-alpine AS runner +FROM base AS runner ENV NODE_ENV=docker # Delete default node user @@ -39,20 +44,16 @@ RUN apk update --no-cache \ && apk upgrade --no-cache \ && apk add --no-cache curl caddy su-exec openssl -WORKDIR /opt/app/frontend -COPY --from=frontend-builder /opt/app/public ./public -COPY --from=frontend-builder /opt/app/.next/standalone ./ -COPY --from=frontend-builder /opt/app/.next/static ./.next/static +COPY --from=frontend-builder /opt/app/public ./frontend/public +COPY --from=frontend-builder /opt/app/.next/standalone ./frontend/ +COPY --from=frontend-builder /opt/app/.next/static ./frontend/.next/static COPY --from=frontend-builder /opt/app/public/img /tmp/img -WORKDIR /opt/app/backend -COPY --from=backend-builder /opt/app/node_modules ./node_modules -COPY --from=backend-builder /opt/app/dist ./dist -COPY --from=backend-builder /opt/app/prisma ./prisma -COPY --from=backend-builder /opt/app/package.json ./ -COPY --from=backend-builder /opt/app/tsconfig.json ./ - -WORKDIR /opt/app +COPY --from=backend-builder /opt/app/node_modules ./backend/node_modules +COPY --from=backend-builder /opt/app/dist ./backend/dist +COPY --from=backend-builder /opt/app/prisma ./backend/prisma +COPY --from=backend-builder /opt/app/package.json ./backend/ +COPY --from=backend-builder /opt/app/tsconfig.json ./backend/ COPY ./reverse-proxy /opt/app/reverse-proxy COPY ./scripts/docker ./scripts/docker diff --git a/backend/package.json b/backend/package.json index 7ef8ecf85..ede9b8ef8 100644 --- a/backend/package.json +++ b/backend/package.json @@ -4,10 +4,10 @@ "scripts": { "build": "nest build", "dev": "cross-env NODE_ENV=development nest start --watch", - "prod": "prisma migrate deploy && prisma db seed && node dist/src/main", + "prod": "prisma migrate deploy --schema=prisma/sqlite/schema/ && prisma db seed --schema=prisma/sqlite/schema/ && node dist/src/main", "lint": "eslint 'src/**/*.ts'", "format": "prettier --end-of-line=auto --write 'src/**/*.ts'", - "test:system": "prisma migrate reset -f && nest start & wait-on http://localhost:8080/api/configs && newman run ./test/newman-system-tests.json" + "test:system": "prisma migrate reset -f --schema=prisma/sqlite/schema/ && nest start & wait-on http://localhost:8080/api/configs && newman run ./test/newman-system-tests.json" }, "prisma": { "seed": "ts-node prisma/seed/config.seed.ts" diff --git a/backend/prisma/.env b/backend/prisma/postgresql/.env similarity index 60% rename from backend/prisma/.env rename to backend/prisma/postgresql/.env index cecaf528e..79912a742 100644 --- a/backend/prisma/.env +++ b/backend/prisma/postgresql/.env @@ -1,2 +1,2 @@ #This file is only used to set a default value for the database url -DATABASE_URL="file:../data/pingvin-share.db" \ No newline at end of file +DATABASE_URL="postgresql://localhost" \ No newline at end of file diff --git a/backend/prisma/postgresql/schema/generator.prisma b/backend/prisma/postgresql/schema/generator.prisma new file mode 120000 index 000000000..5933145cf --- /dev/null +++ b/backend/prisma/postgresql/schema/generator.prisma @@ -0,0 +1 @@ +../../schema/generator.prisma \ No newline at end of file diff --git a/backend/prisma/postgresql/schema/migrations/20250506142711_init/migration.sql b/backend/prisma/postgresql/schema/migrations/20250506142711_init/migration.sql new file mode 100644 index 000000000..9e41aec59 --- /dev/null +++ b/backend/prisma/postgresql/schema/migrations/20250506142711_init/migration.sql @@ -0,0 +1,192 @@ +-- CreateTable +CREATE TABLE "User" ( + "id" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + "username" TEXT NOT NULL, + "email" TEXT NOT NULL, + "password" TEXT, + "isAdmin" BOOLEAN NOT NULL DEFAULT false, + "ldapDN" TEXT, + "totpEnabled" BOOLEAN NOT NULL DEFAULT false, + "totpVerified" BOOLEAN NOT NULL DEFAULT false, + "totpSecret" TEXT, + + CONSTRAINT "User_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "RefreshToken" ( + "id" TEXT NOT NULL, + "token" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "expiresAt" TIMESTAMP(3) NOT NULL, + "userId" TEXT NOT NULL, + "oauthIDToken" TEXT, + + CONSTRAINT "RefreshToken_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "LoginToken" ( + "token" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "expiresAt" TIMESTAMP(3) NOT NULL, + "userId" TEXT NOT NULL, + "used" BOOLEAN NOT NULL DEFAULT false, + + CONSTRAINT "LoginToken_pkey" PRIMARY KEY ("token") +); + +-- CreateTable +CREATE TABLE "ResetPasswordToken" ( + "token" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "expiresAt" TIMESTAMP(3) NOT NULL, + "userId" TEXT NOT NULL, + + CONSTRAINT "ResetPasswordToken_pkey" PRIMARY KEY ("token") +); + +-- CreateTable +CREATE TABLE "OAuthUser" ( + "id" TEXT NOT NULL, + "provider" TEXT NOT NULL, + "providerUserId" TEXT NOT NULL, + "providerUsername" TEXT NOT NULL, + "userId" TEXT NOT NULL, + + CONSTRAINT "OAuthUser_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Share" ( + "id" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "name" TEXT, + "uploadLocked" BOOLEAN NOT NULL DEFAULT false, + "isZipReady" BOOLEAN NOT NULL DEFAULT false, + "views" INTEGER NOT NULL DEFAULT 0, + "expiration" TIMESTAMP(3) NOT NULL, + "description" TEXT, + "removedReason" TEXT, + "creatorId" TEXT, + "reverseShareId" TEXT, + "storageProvider" TEXT NOT NULL DEFAULT 'LOCAL', + + CONSTRAINT "Share_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ReverseShare" ( + "id" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "token" TEXT NOT NULL, + "shareExpiration" TIMESTAMP(3) NOT NULL, + "maxShareSize" TEXT NOT NULL, + "sendEmailNotification" BOOLEAN NOT NULL, + "remainingUses" INTEGER NOT NULL, + "simplified" BOOLEAN NOT NULL DEFAULT false, + "publicAccess" BOOLEAN NOT NULL DEFAULT true, + "creatorId" TEXT NOT NULL, + + CONSTRAINT "ReverseShare_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ShareRecipient" ( + "id" TEXT NOT NULL, + "email" TEXT NOT NULL, + "shareId" TEXT NOT NULL, + + CONSTRAINT "ShareRecipient_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "File" ( + "id" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "name" TEXT NOT NULL, + "size" TEXT NOT NULL, + "shareId" TEXT NOT NULL, + + CONSTRAINT "File_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ShareSecurity" ( + "id" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "password" TEXT, + "maxViews" INTEGER, + "shareId" TEXT, + + CONSTRAINT "ShareSecurity_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Config" ( + "updatedAt" TIMESTAMP(3) NOT NULL, + "name" TEXT NOT NULL, + "category" TEXT NOT NULL, + "type" TEXT NOT NULL, + "defaultValue" TEXT NOT NULL DEFAULT '', + "value" TEXT, + "obscured" BOOLEAN NOT NULL DEFAULT false, + "secret" BOOLEAN NOT NULL DEFAULT true, + "locked" BOOLEAN NOT NULL DEFAULT false, + "order" INTEGER NOT NULL, + + CONSTRAINT "Config_pkey" PRIMARY KEY ("name","category") +); + +-- CreateIndex +CREATE UNIQUE INDEX "User_username_key" ON "User"("username"); + +-- CreateIndex +CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); + +-- CreateIndex +CREATE UNIQUE INDEX "User_ldapDN_key" ON "User"("ldapDN"); + +-- CreateIndex +CREATE UNIQUE INDEX "RefreshToken_token_key" ON "RefreshToken"("token"); + +-- CreateIndex +CREATE UNIQUE INDEX "ResetPasswordToken_userId_key" ON "ResetPasswordToken"("userId"); + +-- CreateIndex +CREATE UNIQUE INDEX "ReverseShare_token_key" ON "ReverseShare"("token"); + +-- CreateIndex +CREATE UNIQUE INDEX "ShareSecurity_shareId_key" ON "ShareSecurity"("shareId"); + +-- AddForeignKey +ALTER TABLE "RefreshToken" ADD CONSTRAINT "RefreshToken_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "LoginToken" ADD CONSTRAINT "LoginToken_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ResetPasswordToken" ADD CONSTRAINT "ResetPasswordToken_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "OAuthUser" ADD CONSTRAINT "OAuthUser_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Share" ADD CONSTRAINT "Share_creatorId_fkey" FOREIGN KEY ("creatorId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Share" ADD CONSTRAINT "Share_reverseShareId_fkey" FOREIGN KEY ("reverseShareId") REFERENCES "ReverseShare"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ReverseShare" ADD CONSTRAINT "ReverseShare_creatorId_fkey" FOREIGN KEY ("creatorId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ShareRecipient" ADD CONSTRAINT "ShareRecipient_shareId_fkey" FOREIGN KEY ("shareId") REFERENCES "Share"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "File" ADD CONSTRAINT "File_shareId_fkey" FOREIGN KEY ("shareId") REFERENCES "Share"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ShareSecurity" ADD CONSTRAINT "ShareSecurity_shareId_fkey" FOREIGN KEY ("shareId") REFERENCES "Share"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/backend/prisma/postgresql/schema/migrations/migration_lock.toml b/backend/prisma/postgresql/schema/migrations/migration_lock.toml new file mode 100644 index 000000000..044d57cdb --- /dev/null +++ b/backend/prisma/postgresql/schema/migrations/migration_lock.toml @@ -0,0 +1,3 @@ +# Please do not edit this file manually +# It should be added in your version-control system (e.g., Git) +provider = "postgresql" diff --git a/backend/prisma/postgresql/schema/models.prisma b/backend/prisma/postgresql/schema/models.prisma new file mode 120000 index 000000000..33c3de443 --- /dev/null +++ b/backend/prisma/postgresql/schema/models.prisma @@ -0,0 +1 @@ +../../schema/models.prisma \ No newline at end of file diff --git a/backend/prisma/postgresql/schema/schema.prisma b/backend/prisma/postgresql/schema/schema.prisma new file mode 100644 index 000000000..c26ac8e3a --- /dev/null +++ b/backend/prisma/postgresql/schema/schema.prisma @@ -0,0 +1,4 @@ +datasource db { + provider = "postgresql" + url = env("DATABASE_URL") +} diff --git a/backend/prisma/schema/generator.prisma b/backend/prisma/schema/generator.prisma new file mode 100644 index 000000000..d97cee6a8 --- /dev/null +++ b/backend/prisma/schema/generator.prisma @@ -0,0 +1,4 @@ +generator client { + provider = "prisma-client-js" + previewFeatures = ["prismaSchemaFolder"] +} diff --git a/backend/prisma/schema.prisma b/backend/prisma/schema/models.prisma similarity index 96% rename from backend/prisma/schema.prisma rename to backend/prisma/schema/models.prisma index b473283e3..7c051930b 100644 --- a/backend/prisma/schema.prisma +++ b/backend/prisma/schema/models.prisma @@ -1,12 +1,3 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "sqlite" - url = env("DATABASE_URL") -} - model User { id String @id @default(uuid()) createdAt DateTime @default(now()) diff --git a/backend/prisma/seed/config.seed.ts b/backend/prisma/seed/config.seed.ts index e5a1c4226..24d9cb396 100644 --- a/backend/prisma/seed/config.seed.ts +++ b/backend/prisma/seed/config.seed.ts @@ -412,7 +412,7 @@ const prisma = new PrismaClient({ db: { url: process.env.DATABASE_URL || - "file:../data/pingvin-share.db?connection_limit=1", + "file:../../data/pingvin-share.db?connection_limit=1", }, }, }); diff --git a/backend/prisma/sqlite/.env b/backend/prisma/sqlite/.env new file mode 100644 index 000000000..fc39f80e3 --- /dev/null +++ b/backend/prisma/sqlite/.env @@ -0,0 +1,2 @@ +#This file is only used to set a default value for the database url +DATABASE_URL="file:../../../data/pingvin-share.db" \ No newline at end of file diff --git a/backend/prisma/sqlite/schema/datasource.prisma b/backend/prisma/sqlite/schema/datasource.prisma new file mode 100644 index 000000000..620b00703 --- /dev/null +++ b/backend/prisma/sqlite/schema/datasource.prisma @@ -0,0 +1,4 @@ +datasource db { + provider = "sqlite" + url = env("DATABASE_URL") +} diff --git a/backend/prisma/sqlite/schema/generator.prisma b/backend/prisma/sqlite/schema/generator.prisma new file mode 120000 index 000000000..5933145cf --- /dev/null +++ b/backend/prisma/sqlite/schema/generator.prisma @@ -0,0 +1 @@ +../../schema/generator.prisma \ No newline at end of file diff --git a/backend/prisma/migrations/20221011172612_init/migration.sql b/backend/prisma/sqlite/schema/migrations/20221011172612_init/migration.sql similarity index 100% rename from backend/prisma/migrations/20221011172612_init/migration.sql rename to backend/prisma/sqlite/schema/migrations/20221011172612_init/migration.sql diff --git a/backend/prisma/migrations/20221013212615_cascade_delete_on_share/migration.sql b/backend/prisma/sqlite/schema/migrations/20221013212615_cascade_delete_on_share/migration.sql similarity index 100% rename from backend/prisma/migrations/20221013212615_cascade_delete_on_share/migration.sql rename to backend/prisma/sqlite/schema/migrations/20221013212615_cascade_delete_on_share/migration.sql diff --git a/backend/prisma/migrations/20221018123139_make_creator_optional/migration.sql b/backend/prisma/sqlite/schema/migrations/20221018123139_make_creator_optional/migration.sql similarity index 100% rename from backend/prisma/migrations/20221018123139_make_creator_optional/migration.sql rename to backend/prisma/sqlite/schema/migrations/20221018123139_make_creator_optional/migration.sql diff --git a/backend/prisma/migrations/20221113221005_share_recipient/migration.sql b/backend/prisma/sqlite/schema/migrations/20221113221005_share_recipient/migration.sql similarity index 100% rename from backend/prisma/migrations/20221113221005_share_recipient/migration.sql rename to backend/prisma/sqlite/schema/migrations/20221113221005_share_recipient/migration.sql diff --git a/backend/prisma/migrations/20221201220540_config_and_admin_functionalities/migration.sql b/backend/prisma/sqlite/schema/migrations/20221201220540_config_and_admin_functionalities/migration.sql similarity index 100% rename from backend/prisma/migrations/20221201220540_config_and_admin_functionalities/migration.sql rename to backend/prisma/sqlite/schema/migrations/20221201220540_config_and_admin_functionalities/migration.sql diff --git a/backend/prisma/migrations/20221208191607_v0_3_3/migration.sql b/backend/prisma/sqlite/schema/migrations/20221208191607_v0_3_3/migration.sql similarity index 100% rename from backend/prisma/migrations/20221208191607_v0_3_3/migration.sql rename to backend/prisma/sqlite/schema/migrations/20221208191607_v0_3_3/migration.sql diff --git a/backend/prisma/migrations/20221213173854_v0_3_6/migration.sql b/backend/prisma/sqlite/schema/migrations/20221213173854_v0_3_6/migration.sql similarity index 100% rename from backend/prisma/migrations/20221213173854_v0_3_6/migration.sql rename to backend/prisma/sqlite/schema/migrations/20221213173854_v0_3_6/migration.sql diff --git a/backend/prisma/migrations/20221219061131_user_entity/migration.sql b/backend/prisma/sqlite/schema/migrations/20221219061131_user_entity/migration.sql similarity index 100% rename from backend/prisma/migrations/20221219061131_user_entity/migration.sql rename to backend/prisma/sqlite/schema/migrations/20221219061131_user_entity/migration.sql diff --git a/backend/prisma/migrations/20221230120407_category_attribute_config/migration.sql b/backend/prisma/sqlite/schema/migrations/20221230120407_category_attribute_config/migration.sql similarity index 100% rename from backend/prisma/migrations/20221230120407_category_attribute_config/migration.sql rename to backend/prisma/sqlite/schema/migrations/20221230120407_category_attribute_config/migration.sql diff --git a/backend/prisma/migrations/20230104145733_v0_5_1/migration.sql b/backend/prisma/sqlite/schema/migrations/20230104145733_v0_5_1/migration.sql similarity index 100% rename from backend/prisma/migrations/20230104145733_v0_5_1/migration.sql rename to backend/prisma/sqlite/schema/migrations/20230104145733_v0_5_1/migration.sql diff --git a/backend/prisma/migrations/20230113080918_removed_reason_attribute/migration.sql b/backend/prisma/sqlite/schema/migrations/20230113080918_removed_reason_attribute/migration.sql similarity index 100% rename from backend/prisma/migrations/20230113080918_removed_reason_attribute/migration.sql rename to backend/prisma/sqlite/schema/migrations/20230113080918_removed_reason_attribute/migration.sql diff --git a/backend/prisma/migrations/20230126125501_reverse_shares/migration.sql b/backend/prisma/sqlite/schema/migrations/20230126125501_reverse_shares/migration.sql similarity index 100% rename from backend/prisma/migrations/20230126125501_reverse_shares/migration.sql rename to backend/prisma/sqlite/schema/migrations/20230126125501_reverse_shares/migration.sql diff --git a/backend/prisma/migrations/20230209205230_v0_10_0/migration.sql b/backend/prisma/sqlite/schema/migrations/20230209205230_v0_10_0/migration.sql similarity index 100% rename from backend/prisma/migrations/20230209205230_v0_10_0/migration.sql rename to backend/prisma/sqlite/schema/migrations/20230209205230_v0_10_0/migration.sql diff --git a/backend/prisma/migrations/20230303091601_v0_11_0/migration.sql b/backend/prisma/sqlite/schema/migrations/20230303091601_v0_11_0/migration.sql similarity index 100% rename from backend/prisma/migrations/20230303091601_v0_11_0/migration.sql rename to backend/prisma/sqlite/schema/migrations/20230303091601_v0_11_0/migration.sql diff --git a/backend/prisma/migrations/20230319120712_edited_value/migration.sql b/backend/prisma/sqlite/schema/migrations/20230319120712_edited_value/migration.sql similarity index 100% rename from backend/prisma/migrations/20230319120712_edited_value/migration.sql rename to backend/prisma/sqlite/schema/migrations/20230319120712_edited_value/migration.sql diff --git a/backend/prisma/migrations/20230718155819_remove_config_veriable_description/migration.sql b/backend/prisma/sqlite/schema/migrations/20230718155819_remove_config_veriable_description/migration.sql similarity index 100% rename from backend/prisma/migrations/20230718155819_remove_config_veriable_description/migration.sql rename to backend/prisma/sqlite/schema/migrations/20230718155819_remove_config_veriable_description/migration.sql diff --git a/backend/prisma/migrations/20231021165436_oauth/migration.sql b/backend/prisma/sqlite/schema/migrations/20231021165436_oauth/migration.sql similarity index 100% rename from backend/prisma/migrations/20231021165436_oauth/migration.sql rename to backend/prisma/sqlite/schema/migrations/20231021165436_oauth/migration.sql diff --git a/backend/prisma/migrations/20240501154254_share_name_property/migration.sql b/backend/prisma/sqlite/schema/migrations/20240501154254_share_name_property/migration.sql similarity index 100% rename from backend/prisma/migrations/20240501154254_share_name_property/migration.sql rename to backend/prisma/sqlite/schema/migrations/20240501154254_share_name_property/migration.sql diff --git a/backend/prisma/migrations/20240609145325_add_simplied_field_for_reverse_share/migration.sql b/backend/prisma/sqlite/schema/migrations/20240609145325_add_simplied_field_for_reverse_share/migration.sql similarity index 100% rename from backend/prisma/migrations/20240609145325_add_simplied_field_for_reverse_share/migration.sql rename to backend/prisma/sqlite/schema/migrations/20240609145325_add_simplied_field_for_reverse_share/migration.sql diff --git a/backend/prisma/migrations/20240725141038_add_public_access_field_for_reverse_share/migration.sql b/backend/prisma/sqlite/schema/migrations/20240725141038_add_public_access_field_for_reverse_share/migration.sql similarity index 100% rename from backend/prisma/migrations/20240725141038_add_public_access_field_for_reverse_share/migration.sql rename to backend/prisma/sqlite/schema/migrations/20240725141038_add_public_access_field_for_reverse_share/migration.sql diff --git a/backend/prisma/migrations/20240803232708_ldap_support/migration.sql b/backend/prisma/sqlite/schema/migrations/20240803232708_ldap_support/migration.sql similarity index 100% rename from backend/prisma/migrations/20240803232708_ldap_support/migration.sql rename to backend/prisma/sqlite/schema/migrations/20240803232708_ldap_support/migration.sql diff --git a/backend/prisma/migrations/20241007181823_oauth_id_token/migration.sql b/backend/prisma/sqlite/schema/migrations/20241007181823_oauth_id_token/migration.sql similarity index 100% rename from backend/prisma/migrations/20241007181823_oauth_id_token/migration.sql rename to backend/prisma/sqlite/schema/migrations/20241007181823_oauth_id_token/migration.sql diff --git a/backend/prisma/migrations/20241218145829_add_s3_support/migration.sql b/backend/prisma/sqlite/schema/migrations/20241218145829_add_s3_support/migration.sql similarity index 100% rename from backend/prisma/migrations/20241218145829_add_s3_support/migration.sql rename to backend/prisma/sqlite/schema/migrations/20241218145829_add_s3_support/migration.sql diff --git a/backend/prisma/migrations/20250102175831_timespan_type_config_variables/migration.sql b/backend/prisma/sqlite/schema/migrations/20250102175831_timespan_type_config_variables/migration.sql similarity index 100% rename from backend/prisma/migrations/20250102175831_timespan_type_config_variables/migration.sql rename to backend/prisma/sqlite/schema/migrations/20250102175831_timespan_type_config_variables/migration.sql diff --git a/backend/prisma/migrations/migration_lock.toml b/backend/prisma/sqlite/schema/migrations/migration_lock.toml similarity index 100% rename from backend/prisma/migrations/migration_lock.toml rename to backend/prisma/sqlite/schema/migrations/migration_lock.toml diff --git a/backend/prisma/sqlite/schema/models.prisma b/backend/prisma/sqlite/schema/models.prisma new file mode 120000 index 000000000..33c3de443 --- /dev/null +++ b/backend/prisma/sqlite/schema/models.prisma @@ -0,0 +1 @@ +../../schema/models.prisma \ No newline at end of file