-- CreateEnum
CREATE TYPE "AccountActivityType" AS ENUM ('TOPUP', 'WITHDRAWAL');

-- CreateTable
CREATE TABLE "account_activity" (
    "id" SERIAL NOT NULL,
    "createAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "eventTime" TIMESTAMP(3) NOT NULL,
    "type" "AccountActivityType" NOT NULL,
    "value" DOUBLE PRECISION,
    "actor" TEXT,
    "accountId" INTEGER NOT NULL,

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

-- AddForeignKey
ALTER TABLE "account_activity" ADD CONSTRAINT "account_activity_accountId_fkey" FOREIGN KEY ("accountId") REFERENCES "account"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
