DROP VIEW "public"."basic_contract_templates_view";--> statement-breakpoint
DROP VIEW "public"."basic_contract_view";--> statement-breakpoint
ALTER TABLE "basic_contract_templates" DROP COLUMN "document_number";--> statement-breakpoint
CREATE VIEW "public"."basic_contract_templates_view" AS (select "id" as "id", "template_name" as "template_name", "status" as "status", "file_name" as "file_name", "file_path" as "file_path", "created_at" as "created_at", "updated_at" as "updated_at" from "basic_contract_templates");--> statement-breakpoint
CREATE VIEW "public"."basic_contract_view" AS (select "basic_contract"."id" as "id", "basic_contract"."template_id" as "template_id", "basic_contract"."vendor_id" as "vendor_id", "basic_contract"."requested_by" as "requested_by", "basic_contract"."status" as "basic_contract_status", "basic_contract"."created_at" as "created_at", "basic_contract"."updated_at" as "updated_at", "vendors"."vendor_code" as "vendor_code", "vendors"."email" as "vendor_email", "users"."name" as "user_name", "basic_contract_templates"."template_name" as "template_name", "basic_contract"."file_name" as "file_name", "basic_contract"."file_path" as "file_path" from "basic_contract" left join "vendors" on "basic_contract"."vendor_id" = "vendors"."id" left join "users" on "basic_contract"."requested_by" = "users"."id" left join "basic_contract_templates" on "basic_contract"."template_id" = "basic_contract_templates"."id");