/*
  Warnings:

  - You are about to drop the column `createdAt` on the `gow_corp_ref` table. All the data in the column will be lost.
  - You are about to drop the column `updatedAt` on the `gow_corp_ref` table. All the data in the column will be lost.
  - You are about to drop the column `corpId` on the `gow_data` table. All the data in the column will be lost.
  - You are about to drop the column `createdAt` on the `gow_data` table. All the data in the column will be lost.
  - You are about to drop the column `updatedAt` on the `gow_data` table. All the data in the column will be lost.
  - You are about to drop the column `createdAt` on the `gow_fac_id` table. All the data in the column will be lost.
  - You are about to drop the column `updatedAt` on the `gow_fac_id` table. All the data in the column will be lost.
  - Added the required column `updated_at` to the `gow_corp_ref` table without a default value. This is not possible if the table is not empty.
  - Added the required column `updated_at` to the `gow_data` table without a default value. This is not possible if the table is not empty.
  - Added the required column `updated_at` to the `gow_fac_id` table without a default value. This is not possible if the table is not empty.

*/
-- AlterTable
ALTER TABLE "gow_corp_ref" DROP COLUMN "createdAt",
DROP COLUMN "updatedAt",
ADD COLUMN     "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN     "updated_at" TIMESTAMP(3) NOT NULL,
ALTER COLUMN "well_name" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "api_no" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "corporate_id" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "current_well_status" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "county_parish" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "state" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "area" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "completion_date" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "pop_first_production" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "operator" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "abandon_date" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "battery" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "common_pad_name" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "id_well" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "lease_id" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "latitude" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "longitude" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "pad_code" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "pad_name" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "permit_number" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "well_sub_status" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "shut_in_date" SET DATA TYPE VARCHAR(4000);

-- AlterTable
ALTER TABLE "gow_data" DROP COLUMN "corpId",
DROP COLUMN "createdAt",
DROP COLUMN "updatedAt",
ADD COLUMN     "corp_id" VARCHAR(4000),
ADD COLUMN     "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN     "updated_at" TIMESTAMP(3) NOT NULL,
ALTER COLUMN "well_name" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "month" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "completion_type" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "state" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "days_on" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "gas_production" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "gas_sales" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "oil_production" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "oil_sales" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "water_production" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "operator" SET DATA TYPE VARCHAR(4000);

-- AlterTable
ALTER TABLE "gow_fac_id" DROP COLUMN "createdAt",
DROP COLUMN "updatedAt",
ADD COLUMN     "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN     "updated_at" TIMESTAMP(3) NOT NULL,
ALTER COLUMN "corp_id" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "odeq_fac_id" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "odeq_facility_name" SET DATA TYPE VARCHAR(4000),
ALTER COLUMN "corp_id_2" SET DATA TYPE VARCHAR(4000);

-- AddForeignKey
ALTER TABLE "gow_fac_id" ADD CONSTRAINT "gow_fac_id_import_id_fkey" FOREIGN KEY ("import_id") REFERENCES "imports"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "gow_data" ADD CONSTRAINT "gow_data_import_id_fkey" FOREIGN KEY ("import_id") REFERENCES "imports"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "gow_corp_ref" ADD CONSTRAINT "gow_corp_ref_import_id_fkey" FOREIGN KEY ("import_id") REFERENCES "imports"("id") ON DELETE CASCADE ON UPDATE CASCADE;
