ALTER TABLE "rfq_last_tbe_pdftron_comments" DROP CONSTRAINT "rfq_last_tbe_pdftron_comments_resolved_by_users_id_fk";
--> statement-breakpoint
DROP INDEX "idx_pdftron_status";--> statement-breakpoint
DROP INDEX "unique_pdftron_annotation";--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" ADD COLUMN "xfdf_string" text NOT NULL;--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" ADD COLUMN "annotation_data" jsonb;--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" ADD COLUMN "comment_summary" jsonb;--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" ADD COLUMN "version" integer DEFAULT 1 NOT NULL;--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" ADD COLUMN "previous_version" integer;--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" ADD COLUMN "last_modified_by" integer;--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" ADD CONSTRAINT "rfq_last_tbe_pdftron_comments_previous_version_rfq_last_tbe_pdftron_comments_id_fk" FOREIGN KEY ("previous_version") REFERENCES "public"."rfq_last_tbe_pdftron_comments"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" ADD CONSTRAINT "rfq_last_tbe_pdftron_comments_last_modified_by_users_id_fk" FOREIGN KEY ("last_modified_by") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "idx_pdftron_doc_id" ON "rfq_last_tbe_pdftron_comments" USING btree ("pdftron_document_id");--> statement-breakpoint
CREATE INDEX "idx_pdftron_version" ON "rfq_last_tbe_pdftron_comments" USING btree ("version");--> statement-breakpoint
CREATE UNIQUE INDEX "unique_latest_version" ON "rfq_last_tbe_pdftron_comments" USING btree ("document_review_id","pdftron_document_id") WHERE "rfq_last_tbe_pdftron_comments"."previous_version" IS NULL;--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" DROP COLUMN "pdftron_annotation_id";--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" DROP COLUMN "annotation_type";--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" DROP COLUMN "page_number";--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" DROP COLUMN "x_position";--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" DROP COLUMN "y_position";--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" DROP COLUMN "coordinates";--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" DROP COLUMN "comment_text";--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" DROP COLUMN "comment_category";--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" DROP COLUMN "severity";--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" DROP COLUMN "status";--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" DROP COLUMN "resolved_by";--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" DROP COLUMN "resolved_at";--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" DROP COLUMN "resolution_note";--> statement-breakpoint
ALTER TABLE "rfq_last_tbe_pdftron_comments" DROP COLUMN "replies";