-- Schema: bird__music_platform_2
CREATE SCHEMA IF NOT EXISTS "bird__music_platform_2";

-- Table: categories
CREATE TABLE "bird__music_platform_2"."categories" (
    "podcast_id" TEXT NOT NULL,
    "category" TEXT NOT NULL,
    CONSTRAINT "PRIMARY" PRIMARY KEY ("podcast_id", "category")
);

-- Table: podcasts
CREATE TABLE "bird__music_platform_2"."podcasts" (
    "podcast_id" TEXT NOT NULL,
    "itunes_id" BIGINT NOT NULL,
    "slug" TEXT NOT NULL,
    "itunes_url" TEXT NOT NULL,
    "title" TEXT NOT NULL,
    CONSTRAINT "podcasts_pkey" PRIMARY KEY ("podcast_id")
);

-- Table: reviews
CREATE TABLE "bird__music_platform_2"."reviews" (
    "podcast_id" TEXT NOT NULL,
    "title" TEXT NOT NULL,
    "content" TEXT NOT NULL,
    "rating" BIGINT NOT NULL,
    "author_id" TEXT NOT NULL,
    "created_at" TEXT NOT NULL
);

-- Table: runs
CREATE TABLE "bird__music_platform_2"."runs" (
    "run_at" TEXT NOT NULL,
    "max_rowid" BIGINT NOT NULL,
    "reviews_added" BIGINT NOT NULL
);

-- Indexes
CREATE INDEX "category_podcast_id_idx" ON "bird__music_platform_2"."categories" ("podcast_id");
