-- CreateTable
CREATE TABLE "tbl_blog_category" (
    "id" SERIAL NOT NULL,
    "name" TEXT NOT NULL,
    "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updated_at" TIMESTAMP(3),
    "deleted_at" TIMESTAMP(3),

    CONSTRAINT "tbl_blog_category_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "tbl_blog" (
    "id" SERIAL NOT NULL,
    "category_id" INTEGER NOT NULL,
    "title" TEXT NOT NULL,
    "image" TEXT,
    "content" TEXT,
    "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updated_at" TIMESTAMP(3),
    "deleted_at" TIMESTAMP(3),

    CONSTRAINT "tbl_blog_pkey" PRIMARY KEY ("id")
);

-- AddForeignKey
ALTER TABLE "tbl_blog" ADD CONSTRAINT "tbl_blog_category_id_fkey" FOREIGN KEY ("category_id") REFERENCES "tbl_blog_category"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
