CREATE SCHEMA "knox";
--> statement-breakpoint
CREATE TABLE "knox"."employee" (
	"ep_id" varchar(25) PRIMARY KEY NOT NULL,
	"employee_number" varchar(20),
	"user_id" varchar(50),
	"full_name" varchar(100),
	"given_name" varchar(100),
	"sir_name" varchar(50),
	"company_code" varchar(10),
	"company_name" varchar(100),
	"department_code" varchar(50),
	"department_name" varchar(255),
	"title_code" varchar(20),
	"title_name" varchar(100),
	"email_address" varchar(255),
	"mobile" varchar(50),
	"employee_status" varchar(2),
	"employee_type" varchar(2),
	"account_status" varchar(2),
	"security_level" varchar(2),
	"preferred_language" varchar(5),
	"description" text,
	"raw" jsonb NOT NULL,
	"created_at" timestamp with time zone DEFAULT now() NOT NULL,
	"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
	"en_company_name" varchar(100),
	"en_department_name" varchar(255),
	"en_discription" varchar(255),
	"en_full_name" varchar(100),
	"en_given_name" varchar(100),
	"en_grade_name" varchar(100),
	"en_sir_name" varchar(50),
	"en_title_name" varchar(100),
	"grade_name" varchar(100),
	"grade_title_indi_code" varchar(2),
	"job_name" varchar(100),
	"real_name_yn" varchar(2),
	"server_location" varchar(2),
	"title_sort_order" varchar(10)
);
--> statement-breakpoint
CREATE INDEX "knox_employee_company_department_idx" ON "knox"."employee" USING btree ("company_code","department_code");--> statement-breakpoint
CREATE INDEX "knox_employee_number_idx" ON "knox"."employee" USING btree ("employee_number");--> statement-breakpoint
CREATE INDEX "knox_employee_user_id_idx" ON "knox"."employee" USING btree ("user_id");--> statement-breakpoint
CREATE INDEX "knox_employee_email_idx" ON "knox"."employee" USING btree ("email_address");