changed to Daphnis

This commit is contained in:
polaris 2024-06-29 02:48:13 -04:00
parent d465e6eb76
commit 22b1c6c8d9
20 changed files with 7 additions and 268 deletions

View File

@ -3,7 +3,7 @@
import { getAuth } from "@/auth/queries/getauth"; import { getAuth } from "@/auth/queries/getauth";
import { artemis } from "@/lib/prisma"; import { artemis } from "@/lib/prisma";
import { daphnis } from "@/lib/prisma"; import { daphnis } from "@/lib/prisma";
import type * as Prisma from '@prisma/client';
export async function getSongsWithTitles(userId: number) { export async function getSongsWithTitles(userId: number) {
try { try {
@ -55,8 +55,10 @@ export async function getSongsWithTitles(userId: number) {
placeId: true, placeId: true,
ticketId: true, ticketId: true,
}, },
}); });
const musicIds = songs const musicIds = songs
.map((song) => song.musicId) .map((song) => song.musicId)
.filter((id) => id !== null) as number[]; .filter((id) => id !== null) as number[];

View File

@ -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;

View File

@ -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`;

View File

@ -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;

View File

@ -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`;

View File

@ -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;

View File

@ -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;

View File

@ -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`);

View File

@ -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;

View File

@ -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`;

View File

@ -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`;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE `user` ADD COLUMN `role` ENUM('ADMIN', 'USER') NOT NULL DEFAULT 'USER';

View File

@ -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"

View File

@ -3664,7 +3664,7 @@ const config = {
"isCustomOutput": true "isCustomOutput": true
}, },
"relativeEnvPaths": { "relativeEnvPaths": {
"rootEnvPath": "../../../../../.env", "rootEnvPath": null,
"schemaEnvPath": "../../../../../.env" "schemaEnvPath": "../../../../../.env"
}, },
"relativePath": "../..", "relativePath": "../..",

View File

@ -3665,7 +3665,7 @@ const config = {
"isCustomOutput": true "isCustomOutput": true
}, },
"relativeEnvPaths": { "relativeEnvPaths": {
"rootEnvPath": "../../../../../.env", "rootEnvPath": null,
"schemaEnvPath": "../../../../../.env" "schemaEnvPath": "../../../../../.env"
}, },
"relativePath": "../..", "relativePath": "../..",

View File

@ -167,7 +167,7 @@ const config = {
"isCustomOutput": true "isCustomOutput": true
}, },
"relativeEnvPaths": { "relativeEnvPaths": {
"rootEnvPath": "../../../../../.env", "rootEnvPath": null,
"schemaEnvPath": "../../../../../.env" "schemaEnvPath": "../../../../../.env"
}, },
"relativePath": "../..", "relativePath": "../..",
@ -177,7 +177,6 @@ const config = {
"db" "db"
], ],
"activeProvider": "mysql", "activeProvider": "mysql",
"postinstall": false,
"inlineDatasources": { "inlineDatasources": {
"db": { "db": {
"url": { "url": {

View File

@ -168,7 +168,7 @@ const config = {
"isCustomOutput": true "isCustomOutput": true
}, },
"relativeEnvPaths": { "relativeEnvPaths": {
"rootEnvPath": "../../../../../.env", "rootEnvPath": null,
"schemaEnvPath": "../../../../../.env" "schemaEnvPath": "../../../../../.env"
}, },
"relativePath": "../..", "relativePath": "../..",
@ -178,7 +178,6 @@ const config = {
"db" "db"
], ],
"activeProvider": "mysql", "activeProvider": "mysql",
"postinstall": false,
"inlineDatasources": { "inlineDatasources": {
"db": { "db": {
"url": { "url": {