diff --git a/prisma/migrations/20250404044756_remove_unusused_small_album_download_column/migration.sql b/prisma/migrations/20250404044756_remove_unusused_small_album_download_column/migration.sql new file mode 100644 index 0000000..6c911e5 --- /dev/null +++ b/prisma/migrations/20250404044756_remove_unusused_small_album_download_column/migration.sql @@ -0,0 +1,8 @@ +/* + Warnings: + + - You are about to drop the column `small` on the `downloads` table. All the data in the column will be lost. + +*/ +-- AlterTable +ALTER TABLE `downloads` DROP COLUMN `small`; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 0b04567..2930090 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -219,11 +219,10 @@ model discs { } model downloads { - id Int @id @default(autoincrement()) - title String? @db.VarChar(255) - small Boolean? + id Int @id @default(autoincrement()) + title String? @db.VarChar(255) albumId Int - album albums? @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "downloads_ibfk_1") + album albums? @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "downloads_ibfk_1") links links[] } diff --git a/src/pages/api/album/create.ts b/src/pages/api/album/create.ts index c43d5fe..24c773f 100644 --- a/src/pages/api/album/create.ts +++ b/src/pages/api/album/create.ts @@ -72,7 +72,6 @@ export const POST: APIRoute = async ({ request, locals }) => { tx.downloads.create({ data: { title: d.title, - small: d.small, albumId: albumRow.id, links: { create: d.links } } diff --git a/src/schemas/album.ts b/src/schemas/album.ts index 7102683..af67f4d 100644 --- a/src/schemas/album.ts +++ b/src/schemas/album.ts @@ -11,7 +11,6 @@ const LinkInput = s.object({ export const DownloadInput = s.object({ title: s.string(), - small: s.defaulted(s.boolean(), false), links: s.defaulted(s.array(LinkInput), []) })