Create Album endpoint

This commit is contained in:
Jorge Vargas 2025-03-08 22:24:22 -06:00
parent c3fca425cb
commit 967a6d1587
15 changed files with 388 additions and 85 deletions

View file

@ -0,0 +1,19 @@
/*
Warnings:
- You are about to drop the column `placeholder` on the `albums` table. All the data in the column will be lost.
- Made the column `status` on table `albums` required. This step will fail if there are existing NULL values in that column.
- Made the column `headerColor` on table `albums` required. This step will fail if there are existing NULL values in that column.
*/
DELETE FROM `albums` WHERE `status` = "Published";
UPDATE `albums` SET `status` = "Show" WHERE LOWER(`status`) = "show";
UPDATE `albums` SET `status` = "Hidden" WHERE LOWER(`status`) = "hidden";
-- AlterTable
ALTER TABLE `albums` DROP COLUMN `placeholder`,
ADD COLUMN `publishedAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
MODIFY `createdAt` DATETIME(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
MODIFY `updatedAt` DATETIME(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
MODIFY `status` ENUM('Show', 'Hidden') NOT NULL DEFAULT 'Hidden',
MODIFY `headerColor` VARCHAR(255) NOT NULL DEFAULT '#ffffff';

View file

@ -0,0 +1,43 @@
/*
Warnings:
- You are about to drop the column `createdAt` on the `artist` table. All the data in the column will be lost.
- You are about to drop the column `updatedAt` on the `artist` table. All the data in the column will be lost.
- You are about to drop the column `createdAt` on the `discs` table. All the data in the column will be lost.
- You are about to drop the column `updatedAt` on the `discs` table. All the data in the column will be lost.
- You are about to drop the column `createdAt` on the `downloads` table. All the data in the column will be lost.
- You are about to drop the column `updatedAt` on the `downloads` table. All the data in the column will be lost.
- You are about to drop the `Album_Type` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `availables` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `type` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE `Album_Type` DROP FOREIGN KEY `Album_Type_ibfk_1`;
-- DropForeignKey
ALTER TABLE `Album_Type` DROP FOREIGN KEY `Album_Type_ibfk_2`;
-- DropForeignKey
ALTER TABLE `availables` DROP FOREIGN KEY `availables_ibfk_1`;
-- AlterTable
ALTER TABLE `artist` DROP COLUMN `createdAt`,
DROP COLUMN `updatedAt`;
-- AlterTable
ALTER TABLE `discs` DROP COLUMN `createdAt`,
DROP COLUMN `updatedAt`;
-- AlterTable
ALTER TABLE `downloads` DROP COLUMN `createdAt`,
DROP COLUMN `updatedAt`;
-- DropTable
DROP TABLE `Album_Type`;
-- DropTable
DROP TABLE `availables`;
-- DropTable
DROP TABLE `type`;