From 22b1c6c8d9fccc8c5599c825473300d8276f9cdc Mon Sep 17 00:00:00 2001 From: polaris Date: Sat, 29 Jun 2024 02:48:13 -0400 Subject: [PATCH] changed to Daphnis --- lib/api.ts | 4 +- .../20240624042044_migration1/migration.sql | 12 ----- .../20240624052325_migration2/migration.sql | 11 ----- .../20240624055108_jwt/migration.sql | 45 ------------------- .../migrations/20240624055712_e/migration.sql | 27 ----------- .../20240624064448_auth/migration.sql | 38 ---------------- .../20240624065813_auth/migration.sql | 12 ----- .../20240624070335_auth/migration.sql | 8 ---- .../20240624144411_authinvite/migration.sql | 30 ------------- .../20240624144643_auth/migration.sql | 18 -------- .../20240624144745_auth/migration.sql | 8 ---- .../20240624145122_authinvite/migration.sql | 15 ------- .../20240624150915_auth/migration.sql | 16 ------- .../20240624151110_auth/migration.sql | 16 ------- .../20240624151602_auth/migration.sql | 2 - prisma/migrations/migration_lock.toml | 3 -- .../schemas/artemis/generated/artemis/edge.js | 2 +- .../artemis/generated/artemis/index.js | 2 +- .../schemas/daphnis/generated/daphnis/edge.js | 3 +- .../daphnis/generated/daphnis/index.js | 3 +- 20 files changed, 7 insertions(+), 268 deletions(-) delete mode 100644 prisma/migrations/20240624042044_migration1/migration.sql delete mode 100644 prisma/migrations/20240624052325_migration2/migration.sql delete mode 100644 prisma/migrations/20240624055108_jwt/migration.sql delete mode 100644 prisma/migrations/20240624055712_e/migration.sql delete mode 100644 prisma/migrations/20240624064448_auth/migration.sql delete mode 100644 prisma/migrations/20240624065813_auth/migration.sql delete mode 100644 prisma/migrations/20240624070335_auth/migration.sql delete mode 100644 prisma/migrations/20240624144411_authinvite/migration.sql delete mode 100644 prisma/migrations/20240624144643_auth/migration.sql delete mode 100644 prisma/migrations/20240624144745_auth/migration.sql delete mode 100644 prisma/migrations/20240624145122_authinvite/migration.sql delete mode 100644 prisma/migrations/20240624150915_auth/migration.sql delete mode 100644 prisma/migrations/20240624151110_auth/migration.sql delete mode 100644 prisma/migrations/20240624151602_auth/migration.sql delete mode 100644 prisma/migrations/migration_lock.toml diff --git a/lib/api.ts b/lib/api.ts index 6ccf1f8..485870d 100644 --- a/lib/api.ts +++ b/lib/api.ts @@ -3,7 +3,7 @@ import { getAuth } from "@/auth/queries/getauth"; import { artemis } from "@/lib/prisma"; import { daphnis } from "@/lib/prisma"; - +import type * as Prisma from '@prisma/client'; export async function getSongsWithTitles(userId: number) { try { @@ -55,8 +55,10 @@ export async function getSongsWithTitles(userId: number) { placeId: true, ticketId: true, }, + }); + const musicIds = songs .map((song) => song.musicId) .filter((id) => id !== null) as number[]; diff --git a/prisma/migrations/20240624042044_migration1/migration.sql b/prisma/migrations/20240624042044_migration1/migration.sql deleted file mode 100644 index f393dea..0000000 --- a/prisma/migrations/20240624042044_migration1/migration.sql +++ /dev/null @@ -1,12 +0,0 @@ --- CreateTable -CREATE TABLE `users` ( - `id` INTEGER NOT NULL AUTO_INCREMENT, - `username` VARCHAR(191) NOT NULL, - `email` VARCHAR(191) NOT NULL, - `password` VARCHAR(191) NOT NULL, - `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), - - UNIQUE INDEX `users_username_key`(`username`), - UNIQUE INDEX `users_email_key`(`email`), - PRIMARY KEY (`id`) -) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; diff --git a/prisma/migrations/20240624052325_migration2/migration.sql b/prisma/migrations/20240624052325_migration2/migration.sql deleted file mode 100644 index fed648e..0000000 --- a/prisma/migrations/20240624052325_migration2/migration.sql +++ /dev/null @@ -1,11 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `email` on the `users` table. All the data in the column will be lost. - -*/ --- DropIndex -DROP INDEX `users_email_key` ON `users`; - --- AlterTable -ALTER TABLE `users` DROP COLUMN `email`; diff --git a/prisma/migrations/20240624055108_jwt/migration.sql b/prisma/migrations/20240624055108_jwt/migration.sql deleted file mode 100644 index 95b5154..0000000 --- a/prisma/migrations/20240624055108_jwt/migration.sql +++ /dev/null @@ -1,45 +0,0 @@ -/* - Warnings: - - - You are about to drop the `users` table. If the table is not empty, all the data it contains will be lost. - -*/ --- DropTable -DROP TABLE `users`; - --- CreateTable -CREATE TABLE `User` ( - `id` INTEGER NOT NULL AUTO_INCREMENT, - `name` VARCHAR(191) NOT NULL, - `email` VARCHAR(191) NOT NULL, - `emailVerified` DATETIME(3) NULL, - `password` VARCHAR(191) NULL, - `image` VARCHAR(191) NULL, - `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), - `updatedAt` DATETIME(3) NOT NULL, - - UNIQUE INDEX `User_email_key`(`email`), - PRIMARY KEY (`id`) -) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; - --- CreateTable -CREATE TABLE `Account` ( - `id` INTEGER NOT NULL AUTO_INCREMENT, - `userId` INTEGER NOT NULL, - `provider` VARCHAR(191) NOT NULL, - `providerAccountId` VARCHAR(191) NOT NULL, - `type` VARCHAR(191) NULL, - `refresh_token` VARCHAR(191) NULL, - `access_token` VARCHAR(191) NULL, - `expires_at` INTEGER NULL, - `token_type` VARCHAR(191) NULL, - `scope` VARCHAR(191) NULL, - `id_token` VARCHAR(191) NULL, - `session_state` VARCHAR(191) NULL, - - UNIQUE INDEX `Account_provider_providerAccountId_key`(`provider`, `providerAccountId`), - PRIMARY KEY (`id`) -) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; - --- AddForeignKey -ALTER TABLE `Account` ADD CONSTRAINT `Account_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/migrations/20240624055712_e/migration.sql b/prisma/migrations/20240624055712_e/migration.sql deleted file mode 100644 index 82970da..0000000 --- a/prisma/migrations/20240624055712_e/migration.sql +++ /dev/null @@ -1,27 +0,0 @@ -/* - Warnings: - - - The primary key for the `user` table will be changed. If it partially fails, the table could be left without primary key constraint. - - You are about to drop the column `emailVerified` on the `user` table. All the data in the column will be lost. - - You are about to drop the column `image` on the `user` table. All the data in the column will be lost. - - You are about to drop the `account` table. If the table is not empty, all the data it contains will be lost. - - Made the column `password` on table `user` required. This step will fail if there are existing NULL values in that column. - -*/ --- DropForeignKey -ALTER TABLE `account` DROP FOREIGN KEY `Account_userId_fkey`; - --- AlterTable -ALTER TABLE `user` DROP PRIMARY KEY, - DROP COLUMN `emailVerified`, - DROP COLUMN `image`, - ADD COLUMN `emailVerifToken` VARCHAR(255) NULL, - ADD COLUMN `emailVerifiedAt` DATETIME(3) NULL, - MODIFY `id` VARCHAR(191) NOT NULL, - MODIFY `name` VARCHAR(255) NOT NULL, - MODIFY `email` VARCHAR(255) NOT NULL, - MODIFY `password` VARCHAR(255) NOT NULL, - ADD PRIMARY KEY (`id`); - --- DropTable -DROP TABLE `account`; diff --git a/prisma/migrations/20240624064448_auth/migration.sql b/prisma/migrations/20240624064448_auth/migration.sql deleted file mode 100644 index 03de573..0000000 --- a/prisma/migrations/20240624064448_auth/migration.sql +++ /dev/null @@ -1,38 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `createdAt` on the `user` table. All the data in the column will be lost. - - You are about to drop the column `emailVerifToken` on the `user` table. All the data in the column will be lost. - - You are about to drop the column `emailVerifiedAt` on the `user` table. All the data in the column will be lost. - - You are about to drop the column `name` on the `user` table. All the data in the column will be lost. - - You are about to drop the column `password` on the `user` table. All the data in the column will be lost. - - You are about to drop the column `updatedAt` on the `user` table. All the data in the column will be lost. - - You are about to alter the column `email` on the `user` table. The data in that column could be lost. The data in that column will be cast from `VarChar(255)` to `VarChar(191)`. - - Added the required column `firstName` to the `User` table without a default value. This is not possible if the table is not empty. - - Added the required column `hashedPassword` to the `User` table without a default value. This is not possible if the table is not empty. - - Added the required column `lastName` to the `User` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE `user` DROP COLUMN `createdAt`, - DROP COLUMN `emailVerifToken`, - DROP COLUMN `emailVerifiedAt`, - DROP COLUMN `name`, - DROP COLUMN `password`, - DROP COLUMN `updatedAt`, - ADD COLUMN `firstName` VARCHAR(191) NOT NULL, - ADD COLUMN `hashedPassword` VARCHAR(191) NOT NULL, - ADD COLUMN `lastName` VARCHAR(191) NOT NULL, - MODIFY `email` VARCHAR(191) NOT NULL; - --- CreateTable -CREATE TABLE `Session` ( - `id` VARCHAR(191) NOT NULL, - `expiresAt` DATETIME(3) NOT NULL, - `userId` VARCHAR(191) NOT NULL, - - PRIMARY KEY (`id`) -) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; - --- AddForeignKey -ALTER TABLE `Session` ADD CONSTRAINT `Session_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/migrations/20240624065813_auth/migration.sql b/prisma/migrations/20240624065813_auth/migration.sql deleted file mode 100644 index eb9928a..0000000 --- a/prisma/migrations/20240624065813_auth/migration.sql +++ /dev/null @@ -1,12 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `firstName` on the `user` table. All the data in the column will be lost. - - You are about to drop the column `lastName` on the `user` table. All the data in the column will be lost. - - Added the required column `username` to the `User` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE `user` DROP COLUMN `firstName`, - DROP COLUMN `lastName`, - ADD COLUMN `username` VARCHAR(191) NOT NULL; diff --git a/prisma/migrations/20240624070335_auth/migration.sql b/prisma/migrations/20240624070335_auth/migration.sql deleted file mode 100644 index c9e1537..0000000 --- a/prisma/migrations/20240624070335_auth/migration.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - Warnings: - - - A unique constraint covering the columns `[username]` on the table `User` will be added. If there are existing duplicate values, this will fail. - -*/ --- CreateIndex -CREATE UNIQUE INDEX `User_username_key` ON `User`(`username`); diff --git a/prisma/migrations/20240624144411_authinvite/migration.sql b/prisma/migrations/20240624144411_authinvite/migration.sql deleted file mode 100644 index eba1205..0000000 --- a/prisma/migrations/20240624144411_authinvite/migration.sql +++ /dev/null @@ -1,30 +0,0 @@ -/* - Warnings: - - - A unique constraint covering the columns `[slug]` on the table `User` will be added. If there are existing duplicate values, this will fail. - - Added the required column `name` to the `User` table without a default value. This is not possible if the table is not empty. - - Added the required column `slug` to the `User` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE `user` ADD COLUMN `description` VARCHAR(191) NULL, - ADD COLUMN `name` VARCHAR(191) NOT NULL, - ADD COLUMN `slug` VARCHAR(191) NOT NULL; - --- CreateTable -CREATE TABLE `Invites` ( - `email` VARCHAR(191) NOT NULL, - `expires` DATETIME(3) NOT NULL, - `projectId` VARCHAR(191) NOT NULL, - `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), - `userId` VARCHAR(191) NULL, - - INDEX `Invites_projectId_idx`(`projectId`), - UNIQUE INDEX `Invites_email_projectId_key`(`email`, `projectId`) -) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; - --- CreateIndex -CREATE UNIQUE INDEX `User_slug_key` ON `User`(`slug`); - --- AddForeignKey -ALTER TABLE `Invites` ADD CONSTRAINT `Invites_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/prisma/migrations/20240624144643_auth/migration.sql b/prisma/migrations/20240624144643_auth/migration.sql deleted file mode 100644 index 8b201a8..0000000 --- a/prisma/migrations/20240624144643_auth/migration.sql +++ /dev/null @@ -1,18 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `description` on the `user` table. All the data in the column will be lost. - - You are about to drop the column `name` on the `user` table. All the data in the column will be lost. - - You are about to drop the column `slug` on the `user` table. All the data in the column will be lost. - -*/ --- DropForeignKey -ALTER TABLE `invites` DROP FOREIGN KEY `Invites_userId_fkey`; - --- DropIndex -DROP INDEX `User_slug_key` ON `user`; - --- AlterTable -ALTER TABLE `user` DROP COLUMN `description`, - DROP COLUMN `name`, - DROP COLUMN `slug`; diff --git a/prisma/migrations/20240624144745_auth/migration.sql b/prisma/migrations/20240624144745_auth/migration.sql deleted file mode 100644 index b39e694..0000000 --- a/prisma/migrations/20240624144745_auth/migration.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - Warnings: - - - You are about to drop the `invites` table. If the table is not empty, all the data it contains will be lost. - -*/ --- DropTable -DROP TABLE `invites`; diff --git a/prisma/migrations/20240624145122_authinvite/migration.sql b/prisma/migrations/20240624145122_authinvite/migration.sql deleted file mode 100644 index 2025f41..0000000 --- a/prisma/migrations/20240624145122_authinvite/migration.sql +++ /dev/null @@ -1,15 +0,0 @@ --- CreateTable -CREATE TABLE `Invites` ( - `email` VARCHAR(191) NOT NULL, - `expires` DATETIME(3) NOT NULL, - `inviteId` VARCHAR(191) NOT NULL, - `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), - `userId` VARCHAR(191) NULL, - - INDEX `Invites_inviteId_idx`(`inviteId`), - UNIQUE INDEX `Invites_email_inviteId_key`(`email`, `inviteId`), - PRIMARY KEY (`inviteId`) -) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; - --- AddForeignKey -ALTER TABLE `Invites` ADD CONSTRAINT `Invites_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/prisma/migrations/20240624150915_auth/migration.sql b/prisma/migrations/20240624150915_auth/migration.sql deleted file mode 100644 index 7ac68cd..0000000 --- a/prisma/migrations/20240624150915_auth/migration.sql +++ /dev/null @@ -1,16 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `userId` on the `session` table. All the data in the column will be lost. - - Added the required column `InvitedBy` to the `Session` table without a default value. This is not possible if the table is not empty. - -*/ --- DropForeignKey -ALTER TABLE `session` DROP FOREIGN KEY `Session_userId_fkey`; - --- AlterTable -ALTER TABLE `session` DROP COLUMN `userId`, - ADD COLUMN `InvitedBy` VARCHAR(191) NOT NULL; - --- AddForeignKey -ALTER TABLE `Session` ADD CONSTRAINT `Session_InvitedBy_fkey` FOREIGN KEY (`InvitedBy`) REFERENCES `User`(`username`) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/migrations/20240624151110_auth/migration.sql b/prisma/migrations/20240624151110_auth/migration.sql deleted file mode 100644 index 44eed15..0000000 --- a/prisma/migrations/20240624151110_auth/migration.sql +++ /dev/null @@ -1,16 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `InvitedBy` on the `session` table. All the data in the column will be lost. - - Added the required column `userId` to the `Session` table without a default value. This is not possible if the table is not empty. - -*/ --- DropForeignKey -ALTER TABLE `session` DROP FOREIGN KEY `Session_InvitedBy_fkey`; - --- AlterTable -ALTER TABLE `session` DROP COLUMN `InvitedBy`, - ADD COLUMN `userId` VARCHAR(191) NOT NULL; - --- AddForeignKey -ALTER TABLE `Session` ADD CONSTRAINT `Session_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/migrations/20240624151602_auth/migration.sql b/prisma/migrations/20240624151602_auth/migration.sql deleted file mode 100644 index 8144104..0000000 --- a/prisma/migrations/20240624151602_auth/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE `user` ADD COLUMN `role` ENUM('ADMIN', 'USER') NOT NULL DEFAULT 'USER'; diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml deleted file mode 100644 index e5a788a..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 (i.e. Git) -provider = "mysql" \ No newline at end of file diff --git a/prisma/schemas/artemis/generated/artemis/edge.js b/prisma/schemas/artemis/generated/artemis/edge.js index 8a49d35..838bdf6 100644 --- a/prisma/schemas/artemis/generated/artemis/edge.js +++ b/prisma/schemas/artemis/generated/artemis/edge.js @@ -3664,7 +3664,7 @@ const config = { "isCustomOutput": true }, "relativeEnvPaths": { - "rootEnvPath": "../../../../../.env", + "rootEnvPath": null, "schemaEnvPath": "../../../../../.env" }, "relativePath": "../..", diff --git a/prisma/schemas/artemis/generated/artemis/index.js b/prisma/schemas/artemis/generated/artemis/index.js index 4e622e9..53be431 100644 --- a/prisma/schemas/artemis/generated/artemis/index.js +++ b/prisma/schemas/artemis/generated/artemis/index.js @@ -3665,7 +3665,7 @@ const config = { "isCustomOutput": true }, "relativeEnvPaths": { - "rootEnvPath": "../../../../../.env", + "rootEnvPath": null, "schemaEnvPath": "../../../../../.env" }, "relativePath": "../..", diff --git a/prisma/schemas/daphnis/generated/daphnis/edge.js b/prisma/schemas/daphnis/generated/daphnis/edge.js index 2bd9e70..eb51211 100644 --- a/prisma/schemas/daphnis/generated/daphnis/edge.js +++ b/prisma/schemas/daphnis/generated/daphnis/edge.js @@ -167,7 +167,7 @@ const config = { "isCustomOutput": true }, "relativeEnvPaths": { - "rootEnvPath": "../../../../../.env", + "rootEnvPath": null, "schemaEnvPath": "../../../../../.env" }, "relativePath": "../..", @@ -177,7 +177,6 @@ const config = { "db" ], "activeProvider": "mysql", - "postinstall": false, "inlineDatasources": { "db": { "url": { diff --git a/prisma/schemas/daphnis/generated/daphnis/index.js b/prisma/schemas/daphnis/generated/daphnis/index.js index 4831d19..54a0ba9 100644 --- a/prisma/schemas/daphnis/generated/daphnis/index.js +++ b/prisma/schemas/daphnis/generated/daphnis/index.js @@ -168,7 +168,7 @@ const config = { "isCustomOutput": true }, "relativeEnvPaths": { - "rootEnvPath": "../../../../../.env", + "rootEnvPath": null, "schemaEnvPath": "../../../../../.env" }, "relativePath": "../..", @@ -178,7 +178,6 @@ const config = { "db" ], "activeProvider": "mysql", - "postinstall": false, "inlineDatasources": { "db": { "url": {