This commit is contained in:
Carl-Gerhard Lindesvärd
2024-02-04 13:23:21 +01:00
parent 30af9cab2f
commit ccd1a1456f
135 changed files with 5588 additions and 1758 deletions

View File

@@ -0,0 +1,17 @@
/*
Warnings:
- The primary key for the `profiles` table will be changed. If it partially fails, the table could be left without primary key constraint.
*/
-- DropForeignKey
ALTER TABLE "events" DROP CONSTRAINT "events_profile_id_fkey";
-- AlterTable
ALTER TABLE "events" ALTER COLUMN "profile_id" SET DATA TYPE TEXT;
-- AlterTable
ALTER TABLE "profiles" DROP CONSTRAINT "profiles_pkey",
ALTER COLUMN "id" DROP DEFAULT,
ALTER COLUMN "id" SET DATA TYPE TEXT,
ADD CONSTRAINT "profiles_pkey" PRIMARY KEY ("id");

View File

@@ -0,0 +1,8 @@
-- CreateTable
CREATE TABLE "salts" (
"salt" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "salts_pkey" PRIMARY KEY ("salt")
);

View File

@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "reports" ADD COLUMN "formula" TEXT;

View File

@@ -0,0 +1,6 @@
-- CreateEnum
CREATE TYPE "Metric" AS ENUM ('sum', 'average', 'min', 'max');
-- AlterTable
ALTER TABLE "reports" ADD COLUMN "metric" "Metric" NOT NULL DEFAULT 'sum',
ADD COLUMN "unit" TEXT;

View File

@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "projects" ADD COLUMN "eventsCount" INTEGER NOT NULL DEFAULT 0;