-- CreateTable
CREATE TABLE "adoption_injection_records" (
    "record_id" BIGSERIAL NOT NULL,
    "adoption_id" VARCHAR(100) NOT NULL,
    "account_sequence" VARCHAR(20) NOT NULL,
    "tree_count" INTEGER NOT NULL,
    "adoption_date" TIMESTAMP(3) NOT NULL,
    "from_address" VARCHAR(42) NOT NULL,
    "to_address" VARCHAR(42) NOT NULL,
    "amount" DECIMAL(36,8) NOT NULL,
    "chain_type" VARCHAR(20) NOT NULL,
    "tx_hash" VARCHAR(66),
    "block_number" BIGINT,
    "gas_used" VARCHAR(50),
    "memo" TEXT,
    "status" VARCHAR(20) NOT NULL DEFAULT 'PENDING',
    "error_message" TEXT,
    "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updated_at" TIMESTAMP(3) NOT NULL,

    CONSTRAINT "adoption_injection_records_pkey" PRIMARY KEY ("record_id")
);

-- CreateIndex
CREATE UNIQUE INDEX "uk_adoption_id" ON "adoption_injection_records"("adoption_id");

-- CreateIndex
CREATE INDEX "idx_injection_account" ON "adoption_injection_records"("account_sequence");

-- CreateIndex
CREATE INDEX "idx_injection_status" ON "adoption_injection_records"("status");

-- CreateIndex
CREATE INDEX "idx_injection_tx_hash" ON "adoption_injection_records"("tx_hash");

-- CreateIndex
CREATE INDEX "idx_injection_created" ON "adoption_injection_records"("created_at");
