-- CreateTable
CREATE TABLE "employers" (
    "id" BIGSERIAL NOT NULL,
    "fullname" VARCHAR(100) NOT NULL,
    "mobile" VARCHAR(100) NOT NULL,
    "mobile_verified_at" TIMESTAMP(3),
    "nationalCode" VARCHAR(50) NOT NULL,
    "email" VARCHAR(250),
    "count_day" INTEGER NOT NULL DEFAULT 60,
    "cost_number" DECIMAL(20,2) NOT NULL,
    "cost_letter" VARCHAR(500) NOT NULL,
    "year_support" INTEGER NOT NULL,
    "teach_time" INTEGER DEFAULT 2,
    "teach_count" INTEGER DEFAULT 1,
    "is_active" BOOLEAN NOT NULL DEFAULT true,
    "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updated_at" TIMESTAMP(3) NOT NULL,
    "deactivated_at" TIMESTAMP(3),
    "deactivated_by_id" BIGINT,

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

-- AddForeignKey
ALTER TABLE "employers" ADD CONSTRAINT "employers_deactivated_by_id_fkey" FOREIGN KEY ("deactivated_by_id") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
