summaryrefslogtreecommitdiff
path: root/db/migrations/0326_pretty_toro.sql
blob: 6ae77048430ca092339dc71f49c5eb9c3fa3587d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
CREATE TABLE "price_adjustment_forms" (
	"id" serial PRIMARY KEY NOT NULL,
	"company_condition_responses_id" integer NOT NULL,
	"item_name" varchar(255),
	"adjustment_reflection_point" varchar(255),
	"major_applicable_raw_material" text,
	"adjustment_formula" text,
	"raw_material_price_index" text,
	"reference_date" date,
	"comparison_date" date,
	"adjustment_ratio" numeric(5, 2),
	"notes" text,
	"adjustment_conditions" text,
	"major_non_applicable_raw_material" text,
	"adjustment_period" varchar(100),
	"contractor_writer" varchar(100),
	"adjustment_date" date,
	"non_applicable_reason" text,
	"created_at" timestamp DEFAULT now() NOT NULL,
	"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "company_condition_responses" ADD COLUMN "is_initial_response" boolean;--> statement-breakpoint
ALTER TABLE "price_adjustment_forms" ADD CONSTRAINT "price_adjustment_forms_company_condition_responses_id_company_condition_responses_id_fk" FOREIGN KEY ("company_condition_responses_id") REFERENCES "public"."company_condition_responses"("id") ON DELETE no action ON UPDATE no action;