- Add album content field for rich text/structured content - Add geolocation support for albums with position and zoom level - Remove direct photo-album relationship in favor of MediaAlbum join table - Support many-to-many relationships between media and albums - Add Album relation to Universe model for better organization This enables albums to have rich content beyond just photos and supports geographic data for location-based albums. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
24 lines
No EOL
795 B
SQL
24 lines
No EOL
795 B
SQL
-- AlterTable
|
|
ALTER TABLE "Album" ADD COLUMN "content" JSONB;
|
|
|
|
-- CreateTable
|
|
CREATE TABLE "GeoLocation" (
|
|
"id" SERIAL NOT NULL,
|
|
"albumId" INTEGER NOT NULL,
|
|
"latitude" DOUBLE PRECISION NOT NULL,
|
|
"longitude" DOUBLE PRECISION NOT NULL,
|
|
"title" VARCHAR(255) NOT NULL,
|
|
"description" TEXT,
|
|
"markerColor" VARCHAR(7),
|
|
"order" INTEGER NOT NULL DEFAULT 0,
|
|
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
|
|
CONSTRAINT "GeoLocation_pkey" PRIMARY KEY ("id")
|
|
);
|
|
|
|
-- CreateIndex
|
|
CREATE INDEX "GeoLocation_albumId_idx" ON "GeoLocation"("albumId");
|
|
|
|
-- AddForeignKey
|
|
ALTER TABLE "GeoLocation" ADD CONSTRAINT "GeoLocation_albumId_fkey" FOREIGN KEY ("albumId") REFERENCES "Album"("id") ON DELETE CASCADE ON UPDATE CASCADE; |