{post.linkUrl}
- {/if}{getPostSnippet(post)}
diff --git a/prisma/dev.db b/prisma/dev.db new file mode 100644 index 0000000..e69de29 diff --git a/prisma/migrations/20250611065244_remove_link_photo_album_post_types/migration.sql b/prisma/migrations/20250611065244_remove_link_photo_album_post_types/migration.sql new file mode 100644 index 0000000..23390ea --- /dev/null +++ b/prisma/migrations/20250611065244_remove_link_photo_album_post_types/migration.sql @@ -0,0 +1,24 @@ +/* + Warnings: + + - You are about to drop the column `albumId` on the `Post` table. All the data in the column will be lost. + - You are about to drop the column `linkDescription` on the `Post` table. All the data in the column will be lost. + - You are about to drop the column `linkUrl` on the `Post` table. All the data in the column will be lost. + - You are about to drop the column `photoId` on the `Post` table. All the data in the column will be lost. + - You are about to drop the `_db_initialization` table. If the table is not empty, all the data it contains will be lost. + +*/ +-- DropForeignKey +ALTER TABLE "Post" DROP CONSTRAINT "Post_albumId_fkey"; + +-- DropForeignKey +ALTER TABLE "Post" DROP CONSTRAINT "Post_photoId_fkey"; + +-- AlterTable +ALTER TABLE "Post" DROP COLUMN "albumId", +DROP COLUMN "linkDescription", +DROP COLUMN "linkUrl", +DROP COLUMN "photoId"; + +-- DropTable +DROP TABLE "_db_initialization"; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index e918944..c62014c 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -43,16 +43,10 @@ model Project { model Post { id Int @id @default(autoincrement()) slug String @unique @db.VarChar(255) - postType String @db.VarChar(50) // blog, microblog, link, photo, album + postType String @db.VarChar(50) // blog, microblog title String? @db.VarChar(255) // Optional for microblog posts content Json? // BlockNote JSON for blog/microblog - // Type-specific fields - linkUrl String? @db.VarChar(500) - linkDescription String? @db.Text - photoId Int? - albumId Int? - featuredImage String? @db.VarChar(500) attachments Json? // Array of media IDs for photo attachments tags Json? // Array of tags @@ -61,10 +55,6 @@ model Post { createdAt DateTime @default(now()) updatedAt DateTime @updatedAt - // Relations - photo Photo? @relation(fields: [photoId], references: [id]) - album Album? @relation(fields: [albumId], references: [id]) - @@index([slug]) @@index([status]) @@index([postType]) @@ -87,7 +77,6 @@ model Album { // Relations photos Photo[] - posts Post[] @@index([slug]) @@index([status]) @@ -118,7 +107,6 @@ model Photo { // Relations album Album? @relation(fields: [albumId], references: [id], onDelete: Cascade) - posts Post[] @@index([slug]) @@index([status]) diff --git a/src/lib/components/DynamicPostContent.svelte b/src/lib/components/DynamicPostContent.svelte index 1522a2a..7fae908 100644 --- a/src/lib/components/DynamicPostContent.svelte +++ b/src/lib/components/DynamicPostContent.svelte @@ -25,17 +25,6 @@ {/if} - {#if post.linkUrl} -
{post.linkDescription}
- {/if} -{post.linkUrl}
- {/if}{getPostSnippet(post)}