/*
 Navicat Premium Data Transfer

 Source Server         : local_postgresql
 Source Server Type    : PostgreSQL
 Source Server Version : 140012
 Source Host           : localhost:5432
 Source Catalog        : little_busters
 Source Schema         : public

 Target Server Type    : PostgreSQL
 Target Server Version : 140012
 File Encoding         : 65001

 Date: 14/02/2025 13:14:12
*/


-- ----------------------------
-- Table structure for activity
-- ----------------------------
DROP TABLE IF EXISTS "public"."activity";
CREATE TABLE "public"."activity" (
  "id" int8 NOT NULL DEFAULT 0,
  "name" varchar(64) COLLATE "pg_catalog"."default" NOT NULL DEFAULT ''::character varying,
  "term" varchar(11) COLLATE "pg_catalog"."default" NOT NULL DEFAULT '2023-2024-1'::character varying,
  "start_time" timestamp(6) NOT NULL DEFAULT now(),
  "end_time" timestamp(6) NOT NULL DEFAULT now(),
  "create_time" timestamp(6) NOT NULL DEFAULT now(),
  "edit_time" timestamp(6) NOT NULL DEFAULT now(),
  "deleted" bool NOT NULL DEFAULT false,
  "status" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "public"."activity"."id" IS '选课活动id';
COMMENT ON COLUMN "public"."activity"."name" IS '活动id';
COMMENT ON COLUMN "public"."activity"."term" IS '学期，格式如2023-2024-1';
COMMENT ON COLUMN "public"."activity"."start_time" IS '开始时间';
COMMENT ON COLUMN "public"."activity"."end_time" IS '结束时间';

-- ----------------------------
-- Records of activity
-- ----------------------------

-- ----------------------------
-- Table structure for activity_target
-- ----------------------------
DROP TABLE IF EXISTS "public"."activity_target";
CREATE TABLE "public"."activity_target" (
  "id" int8 NOT NULL,
  "activity" int8 NOT NULL,
  "grade" int2 NOT NULL,
  "major" int8 NOT NULL,
  "create_time" timestamp(6) NOT NULL DEFAULT now(),
  "edit_time" timestamp(6) NOT NULL DEFAULT now(),
  "deleted" bool NOT NULL DEFAULT false,
  "status" int2 NOT NULL DEFAULT 0,
  "course_list" int8[] NOT NULL
)
;
COMMENT ON COLUMN "public"."activity_target"."activity" IS '活动id';
COMMENT ON COLUMN "public"."activity_target"."grade" IS '年级，入学年份';
COMMENT ON COLUMN "public"."activity_target"."major" IS '专业id';
COMMENT ON COLUMN "public"."activity_target"."course_list" IS '课程id数组';

-- ----------------------------
-- Records of activity_target
-- ----------------------------

-- ----------------------------
-- Table structure for course
-- ----------------------------
DROP TABLE IF EXISTS "public"."course";
CREATE TABLE "public"."course" (
  "id" int8 NOT NULL,
  "name" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "course_hours" int2 NOT NULL,
  "create_time" timestamp(6) NOT NULL DEFAULT now(),
  "edit_time" timestamp(6) NOT NULL DEFAULT now(),
  "spring_term" bool NOT NULL DEFAULT true,
  "deleted" bool NOT NULL DEFAULT false,
  "status" int2 NOT NULL DEFAULT 0,
  "exam_ratio" float4 NOT NULL,
  "distribution" jsonb NOT NULL DEFAULT '{}'::jsonb
)
;
COMMENT ON COLUMN "public"."course"."id" IS '课程id';
COMMENT ON COLUMN "public"."course"."name" IS '课程名称';
COMMENT ON COLUMN "public"."course"."course_hours" IS '课时';
COMMENT ON COLUMN "public"."course"."spring_term" IS '是否春季期课程（false即是秋季期）';
COMMENT ON COLUMN "public"."course"."exam_ratio" IS '考试成绩占比';
COMMENT ON COLUMN "public"."course"."distribution" IS '平时分成绩分布，usual_score参考依据';

-- ----------------------------
-- Records of course
-- ----------------------------

-- ----------------------------
-- Table structure for course_schedule
-- ----------------------------
DROP TABLE IF EXISTS "public"."course_schedule";
CREATE TABLE "public"."course_schedule" (
  "id" int8 NOT NULL,
  "course" int8 NOT NULL,
  "start_week" int2 NOT NULL,
  "end_week" int2 NOT NULL,
  "time" int2 NOT NULL,
  "academic_term" varchar(11) COLLATE "pg_catalog"."default" NOT NULL DEFAULT '2023-2024-1'::character varying,
  "place" varchar(255) COLLATE "pg_catalog"."default" NOT NULL DEFAULT ''::character varying,
  "create_time" timestamp(6) NOT NULL DEFAULT now(),
  "edit_time" timestamp(6) NOT NULL DEFAULT now(),
  "weekday" int2 NOT NULL DEFAULT 1,
  "status" int2 NOT NULL DEFAULT 0,
  "deleted" bool NOT NULL DEFAULT false
)
;
COMMENT ON COLUMN "public"."course_schedule"."id" IS '课堂id';
COMMENT ON COLUMN "public"."course_schedule"."course" IS '课程id';
COMMENT ON COLUMN "public"."course_schedule"."start_week" IS '开始周';
COMMENT ON COLUMN "public"."course_schedule"."end_week" IS '结束周';
COMMENT ON COLUMN "public"."course_schedule"."time" IS '节次时间，即第几节课';
COMMENT ON COLUMN "public"."course_schedule"."academic_term" IS '学年学期，格式如2023-2024-2';
COMMENT ON COLUMN "public"."course_schedule"."place" IS '上课地点';
COMMENT ON COLUMN "public"."course_schedule"."weekday" IS '星期几';

-- ----------------------------
-- Records of course_schedule
-- ----------------------------

-- ----------------------------
-- Table structure for course_selection
-- ----------------------------
DROP TABLE IF EXISTS "public"."course_selection";
CREATE TABLE "public"."course_selection" (
  "id" int8 NOT NULL,
  "student" int8 NOT NULL,
  "schedule" int8 NOT NULL,
  "create_time" timestamp(6) NOT NULL DEFAULT now(),
  "edit_time" timestamp(6) NOT NULL DEFAULT now(),
  "deleted" bool NOT NULL DEFAULT false,
  "activity" int8 NOT NULL,
  "status" int2 NOT NULL DEFAULT 0,
  "term" varchar(11) COLLATE "pg_catalog"."default" NOT NULL
)
;
COMMENT ON COLUMN "public"."course_selection"."id" IS '选课记录id';
COMMENT ON COLUMN "public"."course_selection"."student" IS '学生id';
COMMENT ON COLUMN "public"."course_selection"."schedule" IS '课堂id';
COMMENT ON COLUMN "public"."course_selection"."activity" IS '选课时候的活动id';
COMMENT ON COLUMN "public"."course_selection"."term" IS '学期';

-- ----------------------------
-- Records of course_selection
-- ----------------------------

-- ----------------------------
-- Table structure for course_teacher
-- ----------------------------
DROP TABLE IF EXISTS "public"."course_teacher";
CREATE TABLE "public"."course_teacher" (
  "teacher" int8 NOT NULL,
  "course" int8 NOT NULL,
  "create_time" timestamp(6) NOT NULL DEFAULT now(),
  "edit_time" timestamp(6) NOT NULL DEFAULT now(),
  "deleted" bool NOT NULL DEFAULT false,
  "status" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "public"."course_teacher"."teacher" IS '教师id';
COMMENT ON COLUMN "public"."course_teacher"."course" IS '课程班级id';

-- ----------------------------
-- Records of course_teacher
-- ----------------------------

-- ----------------------------
-- Table structure for experiment_item
-- ----------------------------
DROP TABLE IF EXISTS "public"."experiment_item";
CREATE TABLE "public"."experiment_item" (
  "id" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "name" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "course" int8 NOT NULL,
  "create_time" timestamp(6) NOT NULL DEFAULT now(),
  "edit_time" timestamp(6) NOT NULL DEFAULT now(),
  "deleted" bool NOT NULL DEFAULT false,
  "status" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "public"."experiment_item"."id" IS '实验项目id';
COMMENT ON COLUMN "public"."experiment_item"."name" IS '项目名称';
COMMENT ON COLUMN "public"."experiment_item"."course" IS '课程id';

-- ----------------------------
-- Records of experiment_item
-- ----------------------------

-- ----------------------------
-- Table structure for experiment_score
-- ----------------------------
DROP TABLE IF EXISTS "public"."experiment_score";
CREATE TABLE "public"."experiment_score" (
  "id" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "student" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "experiment" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "score" int2 NOT NULL,
  "create_time" timestamp(6) NOT NULL DEFAULT now(),
  "edit_time" timestamp(6) NOT NULL DEFAULT now(),
  "deleted" bool NOT NULL DEFAULT false,
  "status" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "public"."experiment_score"."id" IS '成绩id';
COMMENT ON COLUMN "public"."experiment_score"."student" IS '学生id';
COMMENT ON COLUMN "public"."experiment_score"."experiment" IS '实验id';
COMMENT ON COLUMN "public"."experiment_score"."score" IS '实验分';

-- ----------------------------
-- Records of experiment_score
-- ----------------------------

-- ----------------------------
-- Table structure for major
-- ----------------------------
DROP TABLE IF EXISTS "public"."major";
CREATE TABLE "public"."major" (
  "id" int8 NOT NULL,
  "name" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "create_time" timestamp(6) NOT NULL DEFAULT now(),
  "edit_time" timestamp(6) NOT NULL DEFAULT now(),
  "deleted" bool NOT NULL DEFAULT false,
  "status" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "public"."major"."id" IS '专业id';
COMMENT ON COLUMN "public"."major"."name" IS '专业名称';

-- ----------------------------
-- Records of major
-- ----------------------------

-- ----------------------------
-- Table structure for score
-- ----------------------------
DROP TABLE IF EXISTS "public"."score";
CREATE TABLE "public"."score" (
  "id" int8 NOT NULL,
  "student" int8 NOT NULL,
  "usual_score" float4 NOT NULL,
  "exam_score" float4 NOT NULL,
  "create_time" timestamp(6) NOT NULL DEFAULT now(),
  "edit_time" timestamp(6) NOT NULL DEFAULT now(),
  "deleted" bool NOT NULL DEFAULT false,
  "course" int8 NOT NULL,
  "term" varchar(11) COLLATE "pg_catalog"."default" NOT NULL DEFAULT ''::character varying,
  "status" int2 NOT NULL DEFAULT 0,
  "exam_ratio" float4 NOT NULL DEFAULT 1.0
)
;
COMMENT ON COLUMN "public"."score"."id" IS '成绩id';
COMMENT ON COLUMN "public"."score"."student" IS '学生id';
COMMENT ON COLUMN "public"."score"."usual_score" IS '平时分';
COMMENT ON COLUMN "public"."score"."exam_score" IS '考试分';
COMMENT ON COLUMN "public"."score"."course" IS '课程id';
COMMENT ON COLUMN "public"."score"."term" IS '学期';
COMMENT ON COLUMN "public"."score"."exam_ratio" IS '考试成绩占比';

-- ----------------------------
-- Records of score
-- ----------------------------

-- ----------------------------
-- Table structure for student_info
-- ----------------------------
DROP TABLE IF EXISTS "public"."student_info";
CREATE TABLE "public"."student_info" (
  "id" int8 NOT NULL,
  "student_number" varchar(12) COLLATE "pg_catalog"."default" NOT NULL,
  "name" varchar(16) COLLATE "pg_catalog"."default" NOT NULL,
  "major" int8 NOT NULL,
  "grade" int2 NOT NULL DEFAULT 2,
  "class" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "create_time" timestamp(6) NOT NULL DEFAULT now(),
  "edit_time" timestamp(6) NOT NULL DEFAULT now(),
  "deleted" bool NOT NULL DEFAULT false,
  "status" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "public"."student_info"."id" IS '学生id';
COMMENT ON COLUMN "public"."student_info"."student_number" IS '学号';
COMMENT ON COLUMN "public"."student_info"."name" IS '学生姓名';
COMMENT ON COLUMN "public"."student_info"."major" IS '专业id';
COMMENT ON COLUMN "public"."student_info"."grade" IS '年级，使用大x表示，如大二：2';
COMMENT ON COLUMN "public"."student_info"."class" IS '班级';

-- ----------------------------
-- Records of student_info
-- ----------------------------

-- ----------------------------
-- Table structure for teacher_info
-- ----------------------------
DROP TABLE IF EXISTS "public"."teacher_info";
CREATE TABLE "public"."teacher_info" (
  "id" int8 NOT NULL,
  "name" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "create_time" timestamp(6) NOT NULL DEFAULT now(),
  "edit_time" timestamp(6) NOT NULL DEFAULT now(),
  "deleted" bool NOT NULL DEFAULT false,
  "status" int2 NOT NULL DEFAULT 0
)
;
COMMENT ON COLUMN "public"."teacher_info"."id" IS '教师id';
COMMENT ON COLUMN "public"."teacher_info"."name" IS '教师姓名';

-- ----------------------------
-- Records of teacher_info
-- ----------------------------

-- ----------------------------
-- Table structure for user_basic
-- ----------------------------
DROP TABLE IF EXISTS "public"."user_basic";
CREATE TABLE "public"."user_basic" (
  "id" int8 NOT NULL,
  "username" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "password" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "type" int2 NOT NULL,
  "create_time" timestamp(6) NOT NULL DEFAULT now(),
  "edit_time" timestamp(6) NOT NULL DEFAULT now(),
  "deleted" bool NOT NULL DEFAULT false,
  "status" int2 NOT NULL DEFAULT 0,
  "oid" varchar(255) COLLATE "pg_catalog"."default" NOT NULL DEFAULT ''::character varying
)
;
COMMENT ON COLUMN "public"."user_basic"."id" IS '用户uuid';
COMMENT ON COLUMN "public"."user_basic"."username" IS '用户名，登陆用';
COMMENT ON COLUMN "public"."user_basic"."password" IS '密码';
COMMENT ON COLUMN "public"."user_basic"."type" IS '用户类型，0：学生，1：教师，2：管理员';
COMMENT ON COLUMN "public"."user_basic"."oid" IS 'oidc id';

-- ----------------------------
-- Records of user_basic
-- ----------------------------
INSERT INTO "public"."user_basic" VALUES (0, 'root', '$2a$10$L6bKqBVE9LWlaSWglepokeqd5HKnsptci8uta2PUt0MctfANEk84C', 2, '2025-02-14 05:12:34.578087', '2025-02-14 05:12:34.578087', 'f', 0, '');

-- ----------------------------
-- Function structure for cs_timestamp
-- ----------------------------
DROP FUNCTION IF EXISTS "public"."cs_timestamp"();
CREATE OR REPLACE FUNCTION "public"."cs_timestamp"()
  RETURNS "pg_catalog"."trigger" AS $BODY$
begin
	new.update_time= current_timestame;
	return new;
end
$BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;

-- ----------------------------
-- Indexes structure for table activity
-- ----------------------------
CREATE INDEX "act_idx_end" ON "public"."activity" USING btree (
  "end_time" "pg_catalog"."timestamp_ops" ASC NULLS LAST
);
CREATE INDEX "act_idx_id" ON "public"."activity" USING hash (
  "id" "pg_catalog"."int8_ops"
);
CREATE INDEX "act_idx_start" ON "public"."activity" USING brin (
  "start_time" "pg_catalog"."timestamp_minmax_ops"
);
CREATE INDEX "act_idx_term" ON "public"."activity" USING btree (
  "term" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table activity
-- ----------------------------
ALTER TABLE "public"."activity" ADD CONSTRAINT "activity_pkey" PRIMARY KEY ("id", "term", "start_time", "end_time");

-- ----------------------------
-- Indexes structure for table activity_target
-- ----------------------------
CREATE INDEX "idx_at_act" ON "public"."activity_target" USING btree (
  "activity" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "idx_at_act_major_grade" ON "public"."activity_target" USING btree (
  "grade" "pg_catalog"."int2_ops" ASC NULLS LAST,
  "major" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "activity" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "idx_at_course" ON "public"."activity_target" USING gin (
  "course_list" "pg_catalog"."array_ops"
) WITH (GIN_PENDING_LIST_LIMIT = 128);
CREATE INDEX "idx_at_major_grade" ON "public"."activity_target" USING btree (
  "grade" "pg_catalog"."int2_ops" ASC NULLS LAST,
  "major" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table activity_target
-- ----------------------------
ALTER TABLE "public"."activity_target" ADD CONSTRAINT "activity_course_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table course
-- ----------------------------
CREATE INDEX "course_idx_id" ON "public"."course" USING hash (
  "id" "pg_catalog"."int8_ops"
);
COMMENT ON INDEX "public"."course_idx_id" IS 'id索引';

-- ----------------------------
-- Primary Key structure for table course
-- ----------------------------
ALTER TABLE "public"."course" ADD CONSTRAINT "course_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table course_schedule
-- ----------------------------
CREATE INDEX "cs_idx_course" ON "public"."course_schedule" USING btree (
  "course" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "cs_idx_course_schedule" ON "public"."course_schedule" USING btree (
  "id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "course" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "cs_idx_course_term" ON "public"."course_schedule" USING btree (
  "course" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "academic_term" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "cs_idx_id" ON "public"."course_schedule" USING btree (
  "id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "cs_idx_term" ON "public"."course_schedule" USING btree (
  "academic_term" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table course_schedule
-- ----------------------------
ALTER TABLE "public"."course_schedule" ADD CONSTRAINT "class_pkey" PRIMARY KEY ("id", "course");

-- ----------------------------
-- Indexes structure for table course_selection
-- ----------------------------
CREATE INDEX "course_selection_student_idx" ON "public"."course_selection" USING btree (
  "student" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "term" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "csel_idex_student" ON "public"."course_selection" USING btree (
  "student" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "csel_idx_activity" ON "public"."course_selection" USING btree (
  "activity" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "csel_idx_course" ON "public"."course_selection" USING btree (
  "schedule" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "csel_idx_id" ON "public"."course_selection" USING btree (
  "id" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "csel_idx_id_term" ON "public"."course_selection" USING btree (
  "id" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "term" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table course_selection
-- ----------------------------
ALTER TABLE "public"."course_selection" ADD CONSTRAINT "course_selection_pkey" PRIMARY KEY ("id", "student", "schedule");

-- ----------------------------
-- Indexes structure for table course_teacher
-- ----------------------------
CREATE INDEX "tc_idx_course" ON "public"."course_teacher" USING btree (
  "course" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "tc_idx_teacher" ON "public"."course_teacher" USING btree (
  "teacher" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "teacher_course_teacher_course_idx" ON "public"."course_teacher" USING btree (
  "teacher" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "course" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table experiment_item
-- ----------------------------
ALTER TABLE "public"."experiment_item" ADD CONSTRAINT "course_experiment_pkey" PRIMARY KEY ("id", "course");

-- ----------------------------
-- Primary Key structure for table experiment_score
-- ----------------------------
ALTER TABLE "public"."experiment_score" ADD CONSTRAINT "experiment_score_pkey" PRIMARY KEY ("id", "student", "experiment");

-- ----------------------------
-- Indexes structure for table major
-- ----------------------------
CREATE INDEX "major_idx_id" ON "public"."major" USING hash (
  "id" "pg_catalog"."int8_ops"
);
CREATE INDEX "major_idx_name" ON "public"."major" USING btree (
  "name" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table major
-- ----------------------------
ALTER TABLE "public"."major" ADD CONSTRAINT "major_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table score
-- ----------------------------
CREATE INDEX "score_idx_course_term" ON "public"."score" USING btree (
  "course" "pg_catalog"."int8_ops" ASC NULLS LAST,
  "term" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "score_idx_id" ON "public"."score" USING hash (
  "id" "pg_catalog"."int8_ops"
);
CREATE INDEX "score_idx_student" ON "public"."score" USING btree (
  "student" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table score
-- ----------------------------
ALTER TABLE "public"."score" ADD CONSTRAINT "score_pkey" PRIMARY KEY ("student", "course", "term");

-- ----------------------------
-- Indexes structure for table student_info
-- ----------------------------
CREATE INDEX "stu_dix_grade" ON "public"."student_info" USING btree (
  "grade" "pg_catalog"."int2_ops" ASC NULLS LAST
);
CREATE INDEX "stu_idx_id" ON "public"."student_info" USING hash (
  "id" "pg_catalog"."int8_ops"
);
CREATE INDEX "stu_idx_major" ON "public"."student_info" USING btree (
  "major" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "stu_idx_num" ON "public"."student_info" USING btree (
  "student_number" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table student_info
-- ----------------------------
ALTER TABLE "public"."student_info" ADD CONSTRAINT "student_info_pkey" PRIMARY KEY ("id", "student_number");

-- ----------------------------
-- Indexes structure for table teacher_info
-- ----------------------------
CREATE INDEX "ti_idx_id" ON "public"."teacher_info" USING hash (
  "id" "pg_catalog"."int8_ops"
);

-- ----------------------------
-- Primary Key structure for table teacher_info
-- ----------------------------
ALTER TABLE "public"."teacher_info" ADD CONSTRAINT "teacher_info_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table user_basic
-- ----------------------------
CREATE INDEX "usr_bsic_oid" ON "public"."user_basic" USING hash (
  "oid" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops"
);
CREATE INDEX "usr_idx_id" ON "public"."user_basic" USING hash (
  "id" "pg_catalog"."int8_ops"
);
CREATE INDEX "usr_idx_username" ON "public"."user_basic" USING btree (
  "username" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table user_basic
-- ----------------------------
ALTER TABLE "public"."user_basic" ADD CONSTRAINT "user_pkey" PRIMARY KEY ("id", "username", "password");
