/*
 Navicat Premium Dump SQL

 Source Server         : 10.13.13.1_pgsql
 Source Server Type    : PostgreSQL
 Source Server Version : 180003 (180003)
 Source Host           : 10.13.13.1:5432
 Source Catalog        : art_sports_volunteer
 Source Schema         : public

 Target Server Type    : PostgreSQL
 Target Server Version : 180003 (180003)
 File Encoding         : 65001

 Date: 12/03/2026 09:38:54
*/


-- ----------------------------
-- Table structure for art_history_score_control_line
-- ----------------------------
DROP TABLE IF EXISTS "public"."art_history_score_control_line";
CREATE TABLE "public"."art_history_score_control_line"
(
    "control_id"         int8                                       NOT NULL GENERATED BY DEFAULT AS IDENTITY (
        INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1
),
    "tenant_id"          varchar(20) COLLATE "pg_catalog"."default" NOT NULL DEFAULT '000000'::character varying,
    "del_flag"           char(1) COLLATE "pg_catalog"."default"     NOT NULL DEFAULT '0'::bpchar,
    "province_code"      varchar(6) COLLATE "pg_catalog"."default"  NOT NULL,
    "province_name"      varchar(32) COLLATE "pg_catalog"."default" NOT NULL,
    "year"               int2                                       NOT NULL,
    "major_category"     varchar(25) COLLATE "pg_catalog"."default" NOT NULL,
    "batch_name"         varchar(25) COLLATE "pg_catalog"."default" NOT NULL,
    "subject_type"       varchar(16) COLLATE "pg_catalog"."default" NOT NULL,
    "culture_score"      numeric(6, 2)                                       DEFAULT NULL::numeric,
    "major_score"        numeric(6, 2)                                       DEFAULT NULL::numeric,
    "culture_score_exam" numeric(6, 2)                                       DEFAULT NULL::numeric,
    "major_score_exam"   numeric(6, 2)                                       DEFAULT NULL::numeric,
    "create_dept"        int8,
    "create_by"          int8,
    "create_time"        timestamp(6),
    "update_by"          int8,
    "update_time"        timestamp(6),
    "remark"             varchar(500) COLLATE "pg_catalog"."default"         DEFAULT NULL::character varying
)
;
ALTER TABLE "public"."art_history_score_control_line" OWNER TO "user_3W72AM";
COMMENT
ON COLUMN "public"."art_history_score_control_line"."control_id" IS '省控线主键';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."tenant_id" IS '租户编号';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."del_flag" IS '删除标志（0存在 1删除）';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."province_code" IS '省份行政区划代码';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."province_name" IS '省份名称';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."year" IS '年份';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."major_category" IS '专业类别';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."batch_name" IS '批次';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."subject_type" IS '科类(文/理)';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."culture_score" IS '文化成绩分数';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."major_score" IS '专业成绩分数';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."culture_score_exam" IS '文化成绩校考分数';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."major_score_exam" IS '专业成绩校考分数';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."create_dept" IS '创建部门';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."create_by" IS '创建者';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."create_time" IS '创建时间';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."update_by" IS '更新者';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."update_time" IS '更新时间';
COMMENT
ON COLUMN "public"."art_history_score_control_line"."remark" IS '备注';
COMMENT
ON TABLE "public"."art_history_score_control_line" IS '历年省控线表';

-- ----------------------------
-- Table structure for art_major
-- ----------------------------
DROP TABLE IF EXISTS "public"."art_major";
CREATE TABLE "public"."art_major"
(
    "major_id"             int8                                        NOT NULL GENERATED BY DEFAULT AS IDENTITY (
        INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1
),
    "tenant_id"            varchar(20) COLLATE "pg_catalog"."default"  NOT NULL DEFAULT '000000'::character varying,
    "del_flag"             char(1) COLLATE "pg_catalog"."default"      NOT NULL DEFAULT '0'::bpchar,
    "major_name"           varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
    "education_level"      varchar(16) COLLATE "pg_catalog"."default"  NOT NULL,
    "major_icon"           varchar(255) COLLATE "pg_catalog"."default"          DEFAULT NULL::character varying,
    "schooling_years"      int2,
    "discipline_primary"   varchar(64) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "discipline_secondary" varchar(64) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "degree_awarded"       varchar(64) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "summary"              varchar(1000) COLLATE "pg_catalog"."default"         DEFAULT NULL::character varying,
    "training_direction"   text COLLATE "pg_catalog"."default",
    "core_courses"         text COLLATE "pg_catalog"."default",
    "create_dept"          int8,
    "create_by"            int8,
    "create_time"          timestamp(6),
    "update_by"            int8,
    "update_time"          timestamp(6),
    "remark"               varchar(500) COLLATE "pg_catalog"."default"          DEFAULT NULL::character varying
)
;
ALTER TABLE "public"."art_major" OWNER TO "user_3W72AM";
COMMENT
ON COLUMN "public"."art_major"."major_id" IS '专业主键ID';
COMMENT
ON COLUMN "public"."art_major"."tenant_id" IS '租户编号';
COMMENT
ON COLUMN "public"."art_major"."del_flag" IS '删除标志（0存在 1删除）';
COMMENT
ON COLUMN "public"."art_major"."major_name" IS '专业名称';
COMMENT
ON COLUMN "public"."art_major"."education_level" IS '学历层次';
COMMENT
ON COLUMN "public"."art_major"."major_icon" IS '专业图标';
COMMENT
ON COLUMN "public"."art_major"."schooling_years" IS '学制(年)';
COMMENT
ON COLUMN "public"."art_major"."discipline_primary" IS '所属一级学科';
COMMENT
ON COLUMN "public"."art_major"."discipline_secondary" IS '所属二级学科';
COMMENT
ON COLUMN "public"."art_major"."degree_awarded" IS '授予学士学位';
COMMENT
ON COLUMN "public"."art_major"."summary" IS '专业概括';
COMMENT
ON COLUMN "public"."art_major"."training_direction" IS '培养方向';
COMMENT
ON COLUMN "public"."art_major"."core_courses" IS '主要课程';
COMMENT
ON COLUMN "public"."art_major"."create_dept" IS '创建部门';
COMMENT
ON COLUMN "public"."art_major"."create_by" IS '创建者';
COMMENT
ON COLUMN "public"."art_major"."create_time" IS '创建时间';
COMMENT
ON COLUMN "public"."art_major"."update_by" IS '更新者';
COMMENT
ON COLUMN "public"."art_major"."update_time" IS '更新时间';
COMMENT
ON COLUMN "public"."art_major"."remark" IS '备注';
COMMENT
ON TABLE "public"."art_major" IS '艺术专业库';

-- ----------------------------
-- Table structure for art_school
-- ----------------------------
DROP TABLE IF EXISTS "public"."art_school";
CREATE TABLE "public"."art_school"
(
    "school_id"       int8                                        NOT NULL GENERATED BY DEFAULT AS IDENTITY (
        INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1
),
    "tenant_id"       varchar(20) COLLATE "pg_catalog"."default" DEFAULT '000000'::character varying,
    "main_code"       varchar(32) COLLATE "pg_catalog"."default"  NOT NULL,
    "main_name"       varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
    "short_name"      varchar(64) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "province"        varchar(32) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "city"            varchar(32) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "district"        varchar(32) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "university_type" varchar(32) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "education_level" varchar(16) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "school_nature"   varchar(16) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "supervisor_dept" varchar(64) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "del_flag"        char(1) COLLATE "pg_catalog"."default"     DEFAULT '0'::bpchar,
    "create_dept"     int8,
    "create_by"       int8,
    "create_time"     timestamp(6),
    "update_by"       int8,
    "update_time"     timestamp(6),
    "remark"          varchar(500) COLLATE "pg_catalog"."default"
)
;
ALTER TABLE "public"."art_school" OWNER TO "user_3W72AM";
COMMENT
ON COLUMN "public"."art_school"."school_id" IS '学校主键ID';
COMMENT
ON COLUMN "public"."art_school"."tenant_id" IS '租户编号';
COMMENT
ON COLUMN "public"."art_school"."main_code" IS '学校国标代码';
COMMENT
ON COLUMN "public"."art_school"."main_name" IS '官方全称';
COMMENT
ON COLUMN "public"."art_school"."short_name" IS '简称';
COMMENT
ON COLUMN "public"."art_school"."province" IS '省份';
COMMENT
ON COLUMN "public"."art_school"."city" IS '城市';
COMMENT
ON COLUMN "public"."art_school"."district" IS '区县';
COMMENT
ON COLUMN "public"."art_school"."university_type" IS '院校类型：综合/工科/艺术/财经等';
COMMENT
ON COLUMN "public"."art_school"."education_level" IS '学历层次：本科/专科';
COMMENT
ON COLUMN "public"."art_school"."school_nature" IS '办学性质：公办/民办/中外合作';
COMMENT
ON COLUMN "public"."art_school"."supervisor_dept" IS '主管部门';
COMMENT
ON TABLE "public"."art_school" IS '学校基础信息主表（精简版）';

-- ----------------------------
-- Table structure for art_school_campus
-- ----------------------------
DROP TABLE IF EXISTS "public"."art_school_campus";
CREATE TABLE "public"."art_school_campus"
(
    "campus_id"    int8                                        NOT NULL GENERATED BY DEFAULT AS IDENTITY (
        INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1
),
    "tenant_id"    varchar(20) COLLATE "pg_catalog"."default"  DEFAULT '000000'::character varying,
    "school_id"    int8                                        NOT NULL,
    "campus_name"  varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
    "location"     varchar(256) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "address"      varchar(256) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "lng"          numeric(10, 6)                              DEFAULT NULL::numeric,
    "lat"          numeric(10, 6)                              DEFAULT NULL::numeric,
    "introduction" text COLLATE "pg_catalog"."default",
    "del_flag"     char(1) COLLATE "pg_catalog"."default"      DEFAULT '0'::bpchar,
    "create_dept"  int8,
    "create_by"    int8,
    "create_time"  timestamp(6),
    "update_by"    int8,
    "update_time"  timestamp(6),
    "remark"       varchar(500) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying
)
;
ALTER TABLE "public"."art_school_campus" OWNER TO "user_3W72AM";
COMMENT
ON COLUMN "public"."art_school_campus"."campus_id" IS '主键ID';
COMMENT
ON COLUMN "public"."art_school_campus"."tenant_id" IS '租户编号';
COMMENT
ON COLUMN "public"."art_school_campus"."school_id" IS '学校ID';
COMMENT
ON COLUMN "public"."art_school_campus"."campus_name" IS '校区名称';
COMMENT
ON COLUMN "public"."art_school_campus"."location" IS '校区位置(文本)';
COMMENT
ON COLUMN "public"."art_school_campus"."address" IS '校区地址';
COMMENT
ON COLUMN "public"."art_school_campus"."lng" IS '经度';
COMMENT
ON COLUMN "public"."art_school_campus"."lat" IS '纬度';
COMMENT
ON COLUMN "public"."art_school_campus"."introduction" IS '校区介绍';
COMMENT
ON COLUMN "public"."art_school_campus"."del_flag" IS '删除标志（0代表存在 1代表删除）';
COMMENT
ON COLUMN "public"."art_school_campus"."create_dept" IS '创建部门';
COMMENT
ON COLUMN "public"."art_school_campus"."create_by" IS '创建者';
COMMENT
ON COLUMN "public"."art_school_campus"."create_time" IS '创建时间';
COMMENT
ON COLUMN "public"."art_school_campus"."update_by" IS '更新者';
COMMENT
ON COLUMN "public"."art_school_campus"."update_time" IS '更新时间';
COMMENT
ON COLUMN "public"."art_school_campus"."remark" IS '备注';
COMMENT
ON TABLE "public"."art_school_campus" IS '学校校区表';

-- ----------------------------
-- Table structure for art_school_college
-- ----------------------------
DROP TABLE IF EXISTS "public"."art_school_college";
CREATE TABLE "public"."art_school_college"
(
    "college_id"      int8                                        NOT NULL GENERATED BY DEFAULT AS IDENTITY (
        INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1
),
    "tenant_id"       varchar(20) COLLATE "pg_catalog"."default"  DEFAULT '000000'::character varying,
    "school_id"       int8                                        NOT NULL,
    "college_code"    varchar(32) COLLATE "pg_catalog"."default"  DEFAULT ''::character varying,
    "college_name"    varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
    "introduction"    text COLLATE "pg_catalog"."default",
    "sort_no"         int4                                        DEFAULT 0,
    "del_flag"        char(1) COLLATE "pg_catalog"."default"      DEFAULT '0'::bpchar,
    "create_dept"     int8,
    "create_by"       int8,
    "create_time"     timestamp(6),
    "update_by"       int8,
    "update_time"     timestamp(6),
    "remark"          varchar(500) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
    "college51sdx_id" int4
)
;
ALTER TABLE "public"."art_school_college" OWNER TO "user_3W72AM";
COMMENT
ON COLUMN "public"."art_school_college"."college_id" IS '主键ID';
COMMENT
ON COLUMN "public"."art_school_college"."tenant_id" IS '租户编号';
COMMENT
ON COLUMN "public"."art_school_college"."school_id" IS '学校ID';
COMMENT
ON COLUMN "public"."art_school_college"."college_code" IS '学院编码(可选)';
COMMENT
ON COLUMN "public"."art_school_college"."college_name" IS '学院名称';
COMMENT
ON COLUMN "public"."art_school_college"."introduction" IS '学院介绍';
COMMENT
ON COLUMN "public"."art_school_college"."sort_no" IS '排序';
COMMENT
ON COLUMN "public"."art_school_college"."del_flag" IS '删除标志（0代表存在 1代表删除）';
COMMENT
ON COLUMN "public"."art_school_college"."create_dept" IS '创建部门';
COMMENT
ON COLUMN "public"."art_school_college"."create_by" IS '创建者';
COMMENT
ON COLUMN "public"."art_school_college"."create_time" IS '创建时间';
COMMENT
ON COLUMN "public"."art_school_college"."update_by" IS '更新者';
COMMENT
ON COLUMN "public"."art_school_college"."update_time" IS '更新时间';
COMMENT
ON COLUMN "public"."art_school_college"."remark" IS '备注';
COMMENT
ON TABLE "public"."art_school_college" IS '学校学院(院系)表';

-- ----------------------------
-- Table structure for art_school_detail
-- ----------------------------
DROP TABLE IF EXISTS "public"."art_school_detail";
CREATE TABLE "public"."art_school_detail"
(
    "detail_id"              int8         NOT NULL GENERATED BY DEFAULT AS IDENTITY (
        INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1
),
    "tenant_id"              varchar(20) COLLATE "pg_catalog"."default"  DEFAULT '000000'::character varying,
    "school_id"              int8         NOT NULL,
    "introduction"           text COLLATE "pg_catalog"."default",
    "school_icon"            varchar(512) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "address"                varchar(256) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "contact"                varchar(64) COLLATE "pg_catalog"."default"  DEFAULT ''::character varying,
    "email"                  varchar(128) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "website"                varchar(128) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "postcode"               varchar(16) COLLATE "pg_catalog"."default"  DEFAULT ''::character varying,
    "establish_year"         int2,
    "campus_area_mu"         numeric(12, 2),
    "library_collection"     int8,
    "male_ratio"             numeric(5, 2),
    "female_ratio"           numeric(5, 2),
    "is_985"                 int2                                        DEFAULT 0,
    "is_211"                 int2                                        DEFAULT 0,
    "is_double_first_class"  int2                                        DEFAULT 0,
    "is_key_university"      int2                                        DEFAULT 0,
    "tags"                   text[] COLLATE "pg_catalog"."default",
    "student_count"          int8,
    "teacher_count"          int8,
    "master_point"           int4,
    "doctor_point"           int4,
    "key_major_count"        int4,
    "employment_rate"        numeric(5, 2),
    "satisfaction_rate"      numeric(5, 2),
    "univ_id"                int4,
    "del_flag"               char(1) COLLATE "pg_catalog"."default"      DEFAULT '0'::bpchar,
    "create_dept"            int8,
    "create_by"              int8,
    "create_time"            timestamp(6),
    "update_by"              int8,
    "update_time"            timestamp(6) NOT NULL                       DEFAULT CURRENT_TIMESTAMP,
    "remark"                 varchar(500) COLLATE "pg_catalog"."default",
    "back_ground"            varchar(512) COLLATE "pg_catalog"."default",
    "is_public"              int2                                        DEFAULT 0,
    "master_proportion_rate" numeric(5, 2),
    "abroad_proportion_rate" numeric(5, 2),
    "has_regular"            int2                                        DEFAULT 0,
    "has_junior"             int2                                        DEFAULT 0,
    "has_master"             int2                                        DEFAULT 0,
    "is_double_high_plan"    int2                                        DEFAULT 0,
    "is_strong_plan"         int2                                        DEFAULT 0,
    "twsdl_rank"             int2                                        DEFAULT 0,
    "xyh_rank"               int2                                        DEFAULT 0,
    "wsl_rank"               int2                                        DEFAULT 0,
    "usdalu_rank"            int2                                        DEFAULT 0,
    "qsdalu_rank"            int2                                        DEFAULT 0
)
;
ALTER TABLE "public"."art_school_detail" OWNER TO "user_3W72AM";
COMMENT
ON COLUMN "public"."art_school_detail"."school_id" IS '学校ID';
COMMENT
ON COLUMN "public"."art_school_detail"."school_icon" IS '校徽图标';
COMMENT
ON COLUMN "public"."art_school_detail"."postcode" IS '邮政编码';
COMMENT
ON COLUMN "public"."art_school_detail"."establish_year" IS '建校年份';
COMMENT
ON COLUMN "public"."art_school_detail"."campus_area_mu" IS '占地面积(亩)';
COMMENT
ON COLUMN "public"."art_school_detail"."library_collection" IS '图书馆藏书量';
COMMENT
ON COLUMN "public"."art_school_detail"."is_985" IS '是否985：0否1是';
COMMENT
ON COLUMN "public"."art_school_detail"."is_211" IS '是否211：0否1是';
COMMENT
ON COLUMN "public"."art_school_detail"."is_double_first_class" IS '是否双一流：0否1是';
COMMENT
ON COLUMN "public"."art_school_detail"."is_key_university" IS '省重点高校';
COMMENT
ON COLUMN "public"."art_school_detail"."tags" IS '学校标签数组';
COMMENT
ON COLUMN "public"."art_school_detail"."student_count" IS '在校学生数';
COMMENT
ON COLUMN "public"."art_school_detail"."teacher_count" IS '教职工人数';
COMMENT
ON COLUMN "public"."art_school_detail"."master_point" IS '硕士点数量';
COMMENT
ON COLUMN "public"."art_school_detail"."doctor_point" IS '博士点数量';
COMMENT
ON COLUMN "public"."art_school_detail"."key_major_count" IS '国家级重点专业数';
COMMENT
ON COLUMN "public"."art_school_detail"."employment_rate" IS '就业率%';
COMMENT
ON COLUMN "public"."art_school_detail"."satisfaction_rate" IS '院校满意度%';
COMMENT
ON COLUMN "public"."art_school_detail"."back_ground" IS '页面显示背景图';
COMMENT
ON COLUMN "public"."art_school_detail"."is_public" IS '是否公办：0 否 1 是';
COMMENT
ON COLUMN "public"."art_school_detail"."master_proportion_rate" IS '考研率';
COMMENT
ON COLUMN "public"."art_school_detail"."abroad_proportion_rate" IS '出国率';
COMMENT
ON COLUMN "public"."art_school_detail"."has_regular" IS '是否有普通本科：0否1是';
COMMENT
ON COLUMN "public"."art_school_detail"."has_junior" IS '是否有专科：0否1是';
COMMENT
ON COLUMN "public"."art_school_detail"."has_master" IS '是否有硕士点：0否1是';
COMMENT
ON COLUMN "public"."art_school_detail"."is_double_high_plan" IS '是否双高计划：0否1是';
COMMENT
ON COLUMN "public"."art_school_detail"."is_strong_plan" IS '是否强基计划：0否1是';
COMMENT
ON COLUMN "public"."art_school_detail"."twsdl_rank" IS '泰晤士中国排名';
COMMENT
ON COLUMN "public"."art_school_detail"."xyh_rank" IS '校友会排名';
COMMENT
ON COLUMN "public"."art_school_detail"."wsl_rank" IS '武书连排名';
COMMENT
ON COLUMN "public"."art_school_detail"."usdalu_rank" IS 'US中国排名';
COMMENT
ON COLUMN "public"."art_school_detail"."qsdalu_rank" IS 'QS排名';
COMMENT
ON TABLE "public"."art_school_detail" IS '学校完整详情表（扩展字段全部放这里）';

-- ----------------------------
-- Table structure for art_school_dorm
-- ----------------------------
DROP TABLE IF EXISTS "public"."art_school_dorm";
CREATE TABLE "public"."art_school_dorm"
(
    "dorm_id"       int8 NOT NULL GENERATED BY DEFAULT AS IDENTITY (
        INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1
),
    "tenant_id"     varchar(20) COLLATE "pg_catalog"."default"  DEFAULT '000000'::character varying,
    "campus_id"     int8 NOT NULL,
    "room_size"     int2,
    "bunk_bed_desk" int2                                        DEFAULT '0'::smallint,
    "private_bath"  int2                                        DEFAULT '0'::smallint,
    "tags"          varchar(256) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "description"   varchar(512) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "del_flag"      char(1) COLLATE "pg_catalog"."default"      DEFAULT '0'::bpchar,
    "create_dept"   int8,
    "create_by"     int8,
    "create_time"   timestamp(6),
    "update_by"     int8,
    "update_time"   timestamp(6),
    "remark"        varchar(500) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying
)
;
ALTER TABLE "public"."art_school_dorm" OWNER TO "user_3W72AM";
COMMENT
ON COLUMN "public"."art_school_dorm"."dorm_id" IS '主键ID';
COMMENT
ON COLUMN "public"."art_school_dorm"."tenant_id" IS '租户编号';
COMMENT
ON COLUMN "public"."art_school_dorm"."campus_id" IS '校区ID';
COMMENT
ON COLUMN "public"."art_school_dorm"."room_size" IS '几人间(4/6/8...)';
COMMENT
ON COLUMN "public"."art_school_dorm"."bunk_bed_desk" IS '是否上床下桌(0否1是)';
COMMENT
ON COLUMN "public"."art_school_dorm"."private_bath" IS '是否独立卫浴(0否1是)';
COMMENT
ON COLUMN "public"."art_school_dorm"."tags" IS '宿舍标签(冗余文本：空调/热水/洗衣房...)';
COMMENT
ON COLUMN "public"."art_school_dorm"."description" IS '补充说明';
COMMENT
ON COLUMN "public"."art_school_dorm"."del_flag" IS '删除标志（0代表存在 1代表删除）';
COMMENT
ON COLUMN "public"."art_school_dorm"."create_dept" IS '创建部门';
COMMENT
ON COLUMN "public"."art_school_dorm"."create_by" IS '创建者';
COMMENT
ON COLUMN "public"."art_school_dorm"."create_time" IS '创建时间';
COMMENT
ON COLUMN "public"."art_school_dorm"."update_by" IS '更新者';
COMMENT
ON COLUMN "public"."art_school_dorm"."update_time" IS '更新时间';
COMMENT
ON COLUMN "public"."art_school_dorm"."remark" IS '备注';
COMMENT
ON TABLE "public"."art_school_dorm" IS '校区宿舍条件表';

-- ----------------------------
-- Table structure for art_school_enroll_code
-- ----------------------------
DROP TABLE IF EXISTS "public"."art_school_enroll_code";
CREATE TABLE "public"."art_school_enroll_code"
(
    "id"          int8                                       NOT NULL GENERATED BY DEFAULT AS IDENTITY (
        INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1
),
    "school_id"   int8                                       NOT NULL,
    "enroll_code" varchar(32) COLLATE "pg_catalog"."default" NOT NULL
)
;
ALTER TABLE "public"."art_school_enroll_code" OWNER TO "user_3W72AM";
COMMENT
ON COLUMN "public"."art_school_enroll_code"."id" IS '主键ID';
COMMENT
ON COLUMN "public"."art_school_enroll_code"."school_id" IS '关联学校主表ID';
COMMENT
ON COLUMN "public"."art_school_enroll_code"."enroll_code" IS '招生代码/学校代码（旧表核心关联字段）';
COMMENT
ON TABLE "public"."art_school_enroll_code" IS '学校招生代码表';

-- ----------------------------
-- Table structure for art_school_enroll_plan
-- ----------------------------
DROP TABLE IF EXISTS "public"."art_school_enroll_plan";
CREATE TABLE "public"."art_school_enroll_plan"
(
    "plan_id"         int8                                        NOT NULL GENERATED BY DEFAULT AS IDENTITY (
        INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1
),
    "tenant_id"       varchar(20) COLLATE "pg_catalog"."default"  DEFAULT '000000'::character varying,
    "school_id"       int8                                        NOT NULL,
    "year"            int2                                        NOT NULL,
    "province"        varchar(32) COLLATE "pg_catalog"."default"  NOT NULL,
    "subject_type"    varchar(16) COLLATE "pg_catalog"."default"  DEFAULT ''::character varying,
    "major_id"        int8,
    "major_name"      varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
    "education_level" varchar(16) COLLATE "pg_catalog"."default"  DEFAULT ''::character varying,
    "plan_num"        int4                                        NOT NULL,
    "del_flag"        char(1) COLLATE "pg_catalog"."default"      DEFAULT '0'::bpchar,
    "create_dept"     int8,
    "create_by"       int8,
    "create_time"     timestamp(6),
    "update_by"       int8,
    "update_time"     timestamp(6),
    "remark"          varchar(500) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying
)
;
ALTER TABLE "public"."art_school_enroll_plan" OWNER TO "user_3W72AM";
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."plan_id" IS '主键ID';
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."tenant_id" IS '租户编号';
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."school_id" IS '学校ID';
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."year" IS '年份';
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."province" IS '招生省份';
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."subject_type" IS '分科：文/理/综(或物理/历史...)';
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."major_id" IS '专业ID(可选，有则填)';
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."major_name" IS '专业名称(冗余，没专业ID也能落库)';
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."education_level" IS '学历层次：本科/专科';
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."plan_num" IS '计划数';
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."del_flag" IS '删除标志（0代表存在 1代表删除）';
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."create_dept" IS '创建部门';
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."create_by" IS '创建者';
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."create_time" IS '创建时间';
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."update_by" IS '更新者';
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."update_time" IS '更新时间';
COMMENT
ON COLUMN "public"."art_school_enroll_plan"."remark" IS '备注';
COMMENT
ON TABLE "public"."art_school_enroll_plan" IS '学校招生计划表';

-- ----------------------------
-- Table structure for art_school_major
-- ----------------------------
DROP TABLE IF EXISTS "public"."art_school_major";
CREATE TABLE "public"."art_school_major"
(
    "school_major_id" int8                                        NOT NULL GENERATED BY DEFAULT AS IDENTITY (
        INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1
),
    "tenant_id"       varchar(20) COLLATE "pg_catalog"."default"  DEFAULT '000000'::character varying,
    "school_id"       int8                                        NOT NULL,
    "college_id"      int8,
    "major_code"      varchar(32) COLLATE "pg_catalog"."default"  DEFAULT ''::character varying,
    "major_name"      varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
    "education_level" varchar(16) COLLATE "pg_catalog"."default"  DEFAULT ''::character varying,
    "duration_years"  int2,
    "major_category"  varchar(32) COLLATE "pg_catalog"."default"  DEFAULT ''::character varying,
    "degree_type"     varchar(32) COLLATE "pg_catalog"."default"  DEFAULT ''::character varying,
    "introduction"    text COLLATE "pg_catalog"."default",
    "tags"            varchar(128) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
    "del_flag"        char(1) COLLATE "pg_catalog"."default"      DEFAULT '0'::bpchar,
    "create_dept"     int8,
    "create_by"       int8,
    "create_time"     timestamp(6),
    "update_by"       int8,
    "update_time"     timestamp(6),
    "remark"          varchar(500) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
    "major51sdx_id"   varchar(32) COLLATE "pg_catalog"."default"
)
;
ALTER TABLE "public"."art_school_major" OWNER TO "user_3W72AM";
COMMENT
ON COLUMN "public"."art_school_major"."school_major_id" IS '主键ID';
COMMENT
ON COLUMN "public"."art_school_major"."tenant_id" IS '租户编号';
COMMENT
ON COLUMN "public"."art_school_major"."school_id" IS '学校ID(冗余便于查)';
COMMENT
ON COLUMN "public"."art_school_major"."college_id" IS '学院ID';
COMMENT
ON COLUMN "public"."art_school_major"."major_code" IS '专业编码(可选)';
COMMENT
ON COLUMN "public"."art_school_major"."major_name" IS '专业名称';
COMMENT
ON COLUMN "public"."art_school_major"."education_level" IS '学历层次：本科/专科';
COMMENT
ON COLUMN "public"."art_school_major"."duration_years" IS '学制(3/4/5)';
COMMENT
ON COLUMN "public"."art_school_major"."major_category" IS '专业类别：工学/理学/艺术学...';
COMMENT
ON COLUMN "public"."art_school_major"."degree_type" IS '学位类型：工学学士/理学学士/艺术学学士...';
COMMENT
ON COLUMN "public"."art_school_major"."introduction" IS '专业介绍';
COMMENT
ON COLUMN "public"."art_school_major"."tags" IS '专业标签';
COMMENT
ON COLUMN "public"."art_school_major"."del_flag" IS '删除标志（0代表存在 1代表删除）';
COMMENT
ON COLUMN "public"."art_school_major"."create_dept" IS '创建部门';
COMMENT
ON COLUMN "public"."art_school_major"."create_by" IS '创建者';
COMMENT
ON COLUMN "public"."art_school_major"."create_time" IS '创建时间';
COMMENT
ON COLUMN "public"."art_school_major"."update_by" IS '更新者';
COMMENT
ON COLUMN "public"."art_school_major"."update_time" IS '更新时间';
COMMENT
ON COLUMN "public"."art_school_major"."remark" IS '备注';
COMMENT
ON TABLE "public"."art_school_major" IS '学校专业表';

-- ----------------------------
-- Table structure for art_school_major_tag
-- ----------------------------
DROP TABLE IF EXISTS "public"."art_school_major_tag";
CREATE TABLE "public"."art_school_major_tag"
(
    "major_tag_id" int8                                       NOT NULL GENERATED BY DEFAULT AS IDENTITY (
        INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1
),
    "tenant_id"    varchar(20) COLLATE "pg_catalog"."default" NOT NULL DEFAULT '000000'::character varying,
    "major_id"     int8                                       NOT NULL,
    "tag_name"     varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
    "create_dept"  int8,
    "create_by"    int8,
    "create_time"  timestamp(6),
    "update_by"    int8,
    "update_time"  timestamp(6),
    "del_flag"     char(1) COLLATE "pg_catalog"."default"     NOT NULL DEFAULT '0'::bpchar,
    "remark"       varchar(500) COLLATE "pg_catalog"."default"         DEFAULT NULL::character varying,
    "active_key"   int2 GENERATED ALWAYS AS (

        CASE
        WHEN (del_flag = '0'::bpchar) THEN 1
        ELSE NULL ::integer
END
) STORED
)
;
ALTER TABLE "public"."art_school_major_tag" OWNER TO "user_3W72AM";
COMMENT
ON COLUMN "public"."art_school_major_tag"."major_tag_id" IS '主键ID';
COMMENT
ON COLUMN "public"."art_school_major_tag"."tenant_id" IS '租户编号';
COMMENT
ON COLUMN "public"."art_school_major_tag"."major_id" IS '专业ID';
COMMENT
ON COLUMN "public"."art_school_major_tag"."tag_name" IS '标签名称';
COMMENT
ON COLUMN "public"."art_school_major_tag"."create_dept" IS '创建部门';
COMMENT
ON COLUMN "public"."art_school_major_tag"."create_by" IS '创建人';
COMMENT
ON COLUMN "public"."art_school_major_tag"."create_time" IS '创建时间';
COMMENT
ON COLUMN "public"."art_school_major_tag"."update_by" IS '更新人';
COMMENT
ON COLUMN "public"."art_school_major_tag"."update_time" IS '更新时间';
COMMENT
ON COLUMN "public"."art_school_major_tag"."del_flag" IS '删除标志（0存在 1删除）';
COMMENT
ON COLUMN "public"."art_school_major_tag"."remark" IS '备注';
COMMENT
ON COLUMN "public"."art_school_major_tag"."active_key" IS '仅用于唯一约束';
COMMENT
ON TABLE "public"."art_school_major_tag" IS '专业标签表';

-- ----------------------------
-- Table structure for art_school_media
-- ----------------------------
DROP TABLE IF EXISTS "public"."art_school_media";
CREATE TABLE "public"."art_school_media"
(
    "media_id"    int8                                        NOT NULL GENERATED BY DEFAULT AS IDENTITY (
        INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1
),
    "tenant_id"   varchar(20) COLLATE "pg_catalog"."default"  DEFAULT '000000'::character varying,
    "biz_type"    varchar(32) COLLATE "pg_catalog"."default"  NOT NULL,
    "biz_id"      int8                                        NOT NULL,
    "media_type"  int2                                        NOT NULL,
    "url"         varchar(512) COLLATE "pg_catalog"."default" NOT NULL,
    "cover_url"   varchar(512) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
    "sort_no"     int4                                        DEFAULT 0,
    "del_flag"    char(1) COLLATE "pg_catalog"."default"      DEFAULT '0'::bpchar,
    "create_dept" int8,
    "create_by"   int8,
    "create_time" timestamp(6),
    "update_by"   int8,
    "update_time" timestamp(6),
    "remark"      varchar(500) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying
)
;
ALTER TABLE "public"."art_school_media" OWNER TO "user_3W72AM";
COMMENT
ON COLUMN "public"."art_school_media"."media_id" IS '主键ID';
COMMENT
ON COLUMN "public"."art_school_media"."tenant_id" IS '租户编号';
COMMENT
ON COLUMN "public"."art_school_media"."biz_type" IS '业务类型：school/campus/college/major/dorm';
COMMENT
ON COLUMN "public"."art_school_media"."biz_id" IS '业务主键ID';
COMMENT
ON COLUMN "public"."art_school_media"."media_type" IS '媒体类型：1-图片 2-视频';
COMMENT
ON COLUMN "public"."art_school_media"."url" IS '资源URL';
COMMENT
ON COLUMN "public"."art_school_media"."cover_url" IS '封面URL(视频可用)';
COMMENT
ON COLUMN "public"."art_school_media"."sort_no" IS '排序';
COMMENT
ON COLUMN "public"."art_school_media"."del_flag" IS '删除标志（0代表存在 1代表删除）';
COMMENT
ON COLUMN "public"."art_school_media"."create_dept" IS '创建部门';
COMMENT
ON COLUMN "public"."art_school_media"."create_by" IS '创建者';
COMMENT
ON COLUMN "public"."art_school_media"."create_time" IS '创建时间';
COMMENT
ON COLUMN "public"."art_school_media"."update_by" IS '更新者';
COMMENT
ON COLUMN "public"."art_school_media"."update_time" IS '更新时间';
COMMENT
ON COLUMN "public"."art_school_media"."remark" IS '备注';
COMMENT
ON TABLE "public"."art_school_media" IS '学校媒体资源表(图片/视频)';

-- ----------------------------
-- Table structure for art_school_name
-- ----------------------------
DROP TABLE IF EXISTS "public"."art_school_name";
CREATE TABLE "public"."art_school_name"
(
    "school_name_id"   int8                                       NOT NULL GENERATED BY DEFAULT AS IDENTITY (
        INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1
),
    "tenant_id"        varchar(20) COLLATE "pg_catalog"."default"  DEFAULT '000000'::character varying,
    "school_id"        int8                                       NOT NULL,
    "name"             varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
    "name_type"        int2                                       NOT NULL,
    "name_update_date" int4,
    "del_flag"         char(1) COLLATE "pg_catalog"."default"      DEFAULT '0'::bpchar,
    "create_dept"      int8,
    "create_by"        int8,
    "create_time"      timestamp(6),
    "update_by"        int8,
    "update_time"      timestamp(6),
    "remark"           varchar(500) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying
)
;
ALTER TABLE "public"."art_school_name" OWNER TO "user_3W72AM";
COMMENT
ON COLUMN "public"."art_school_name"."school_name_id" IS '主键ID';
COMMENT
ON COLUMN "public"."art_school_name"."tenant_id" IS '租户编号';
COMMENT
ON COLUMN "public"."art_school_name"."school_id" IS '关联学校主表ID';
COMMENT
ON COLUMN "public"."art_school_name"."name" IS '学校名称（曾用名/别名）';
COMMENT
ON COLUMN "public"."art_school_name"."name_type" IS '名称类型：1-官方全称 2-曾用名 3-别名 4-英文名称';
COMMENT
ON COLUMN "public"."art_school_name"."name_update_date" IS '更新日期';
COMMENT
ON COLUMN "public"."art_school_name"."del_flag" IS '删除标志（0代表存在 1代表删除）';
COMMENT
ON COLUMN "public"."art_school_name"."create_dept" IS '创建部门';
COMMENT
ON COLUMN "public"."art_school_name"."create_by" IS '创建者';
COMMENT
ON COLUMN "public"."art_school_name"."create_time" IS '创建时间';
COMMENT
ON COLUMN "public"."art_school_name"."update_by" IS '更新者';
COMMENT
ON COLUMN "public"."art_school_name"."update_time" IS '更新时间';
COMMENT
ON COLUMN "public"."art_school_name"."remark" IS '备注';
COMMENT
ON TABLE "public"."art_school_name" IS '学校多名称表';

-- ----------------------------
-- Table structure for art_school_recruit_major
-- ----------------------------
DROP TABLE IF EXISTS "public"."art_school_recruit_major";
CREATE TABLE "public"."art_school_recruit_major"
(
    "recruit_major_id"          int8                                        NOT NULL GENERATED BY DEFAULT AS IDENTITY (
        INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1
),
    "tenant_id"                 varchar(20) COLLATE "pg_catalog"."default"  NOT NULL DEFAULT '000000'::character varying,
    "del_flag"                  char(1) COLLATE "pg_catalog"."default"      NOT NULL DEFAULT '0'::bpchar,
    "school_id"                 int8                                        NOT NULL,
    "school_code"               varchar(32) COLLATE "pg_catalog"."default"  NOT NULL,
    "school_name"               varchar(128) COLLATE "pg_catalog"."default" NOT NULL DEFAULT ''::character varying,
    "year"                      int2                                        NOT NULL,
    "major_id"                  int8,
    "major_code"                varchar(32) COLLATE "pg_catalog"."default"  NOT NULL,
    "major_name"                varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
    "enroll_code"               varchar(64) COLLATE "pg_catalog"."default"  NOT NULL DEFAULT ''::character varying,
    "data_status"               varchar(16) COLLATE "pg_catalog"."default"  NOT NULL,
    "batch_name"                varchar(32) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "major_type"                varchar(32) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "major_type_sub"            varchar(32) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "subject_type"              varchar(16) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "admission_way_short"       varchar(32) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "admission_way_external"    varchar(64) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "admission_way_external_op" varchar(8) COLLATE "pg_catalog"."default"            DEFAULT NULL::character varying,
    "admission_way_internal"    varchar(64) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "admission_way_internal_op" varchar(8) COLLATE "pg_catalog"."default"            DEFAULT NULL::character varying,
    "plan_enroll"               int4,
    "main_exam_subject"         varchar(64) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "schooling_years"           int2,
    "enroll_limit_desc"         text COLLATE "pg_catalog"."default",
    "tuition_fee"               numeric(10, 2)                                       DEFAULT NULL::numeric,
    "culture_score_limit"       numeric(6, 2)                                        DEFAULT NULL::numeric,
    "major_score_limit"         numeric(6, 2)                                        DEFAULT NULL::numeric,
    "chinese_score_limit"       numeric(6, 2)                                        DEFAULT NULL::numeric,
    "english_score_limit"       numeric(6, 2)                                        DEFAULT NULL::numeric,
    "remark"                    varchar(500) COLLATE "pg_catalog"."default"          DEFAULT NULL::character varying,
    "create_dept"               int8,
    "create_by"                 int8,
    "create_time"               timestamp(6),
    "update_by"                 int8,
    "update_time"               timestamp(6)
)
;
ALTER TABLE "public"."art_school_recruit_major" OWNER TO "user_3W72AM";
COMMENT
ON COLUMN "public"."art_school_recruit_major"."recruit_major_id" IS '院校招录专业ID';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."tenant_id" IS '租户编号';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."del_flag" IS '删除标志（0存在 1删除）';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."school_id" IS '学校ID';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."school_code" IS '学校代码';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."school_name" IS '学校名称(冗余)';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."year" IS '年份';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."major_id" IS '专业ID';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."major_code" IS '专业代码';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."major_name" IS '专业名称';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."enroll_code" IS '招生代码(为空则存空串)';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."data_status" IS '数据状态(停招/新招/新增)';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."batch_name" IS '批次';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."major_type" IS '专业类型';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."major_type_sub" IS '二级专业类型';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."subject_type" IS '科类(文/理)';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."admission_way_short" IS '录取方式缩写';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."admission_way_external" IS '对外录取方式';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."admission_way_external_op" IS '对外录取方式运算符';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."admission_way_internal" IS '内部录取方式';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."admission_way_internal_op" IS '内部录取方式运算符';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."plan_enroll" IS '计划招生人数';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."main_exam_subject" IS '主考科目';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."schooling_years" IS '学制(年)';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."enroll_limit_desc" IS '院校限制说明';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."tuition_fee" IS '学费(元/年)';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."culture_score_limit" IS '文化分数限制';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."major_score_limit" IS '专业分数限制';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."chinese_score_limit" IS '语文成绩限制';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."english_score_limit" IS '英语成绩限制';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."remark" IS '备注';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."create_dept" IS '创建部门';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."create_by" IS '创建者';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."create_time" IS '创建时间';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."update_by" IS '更新者';
COMMENT
ON COLUMN "public"."art_school_recruit_major"."update_time" IS '更新时间';
COMMENT
ON TABLE "public"."art_school_recruit_major" IS '院校招录专业';

-- ----------------------------
-- Table structure for art_school_recruit_major_history
-- ----------------------------
DROP TABLE IF EXISTS "public"."art_school_recruit_major_history";
CREATE TABLE "public"."art_school_recruit_major_history"
(
    "history_id"                int8                                        NOT NULL GENERATED BY DEFAULT AS IDENTITY (
        INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1
),
    "tenant_id"                 varchar(20) COLLATE "pg_catalog"."default"  NOT NULL DEFAULT '000000'::character varying,
    "del_flag"                  char(1) COLLATE "pg_catalog"."default"      NOT NULL DEFAULT '0'::bpchar,
    "recruit_major_id"          int8                                        NOT NULL,
    "school_id"                 int8                                        NOT NULL,
    "school_code"               varchar(32) COLLATE "pg_catalog"."default"  NOT NULL,
    "college_code"              varchar(32) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "school_name"               varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
    "major_id"                  int8,
    "major_code"                varchar(32) COLLATE "pg_catalog"."default"  NOT NULL,
    "major_name"                varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
    "enroll_code"               varchar(64) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "major_type"                varchar(32) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "major_type_sub"            varchar(32) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "main_exam_subject"         varchar(64) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "year"                      int2                                        NOT NULL,
    "subject_type"              varchar(16) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "batch_name"                varchar(32) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "admission_formula"         varchar(64) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "probability_operator"      varchar(16) COLLATE "pg_catalog"."default"           DEFAULT NULL::character varying,
    "control_score"             numeric(6, 2)                                        DEFAULT NULL::numeric,
    "admission_score"           numeric(6, 2)                                        DEFAULT NULL::numeric,
    "plan_enroll"               int4,
    "filed_amount"              int4,
    "admit_amount"              int4,
    "first_choice_admit_amount" int4,
    "min_score_diff"            numeric(6, 2)                                        DEFAULT NULL::numeric,
    "tuition_fee"               numeric(10, 2)                                       DEFAULT NULL::numeric,
    "remark"                    varchar(500) COLLATE "pg_catalog"."default"          DEFAULT NULL::character varying,
    "create_dept"               int8,
    "create_by"                 int8,
    "create_time"               timestamp(6),
    "update_by"                 int8,
    "update_time"               timestamp(6)
)
;
ALTER TABLE "public"."art_school_recruit_major_history" OWNER TO "user_3W72AM";
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."history_id" IS '历年录取数据ID';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."tenant_id" IS '租户编号';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."del_flag" IS '删除标志（0存在 1删除）';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."recruit_major_id" IS '对应招录专业ID';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."school_id" IS '学校ID';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."school_code" IS '学校代码';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."college_code" IS '院校代码';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."school_name" IS '学校名称';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."major_id" IS '专业ID';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."major_code" IS '专业代码';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."major_name" IS '专业名称';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."enroll_code" IS '招生代码';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."major_type" IS '专业类型';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."major_type_sub" IS '专业类别子级';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."main_exam_subject" IS '主考科目';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."year" IS '年份';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."subject_type" IS '科类(文/理)';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."batch_name" IS '批次';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."admission_formula" IS '录取方式(文*x+专*y)';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."probability_operator" IS '录取概率规则运算符';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."control_score" IS '省控线';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."admission_score" IS '录取线';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."plan_enroll" IS '招生人数';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."filed_amount" IS '实际投档人数';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."admit_amount" IS '录取数';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."first_choice_admit_amount" IS '一志愿录取数';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."min_score_diff" IS '最低分数差';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."tuition_fee" IS '学费(元/年)';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."remark" IS '备注';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."create_dept" IS '创建部门';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."create_by" IS '创建者';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."create_time" IS '创建时间';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."update_by" IS '更新者';
COMMENT
ON COLUMN "public"."art_school_recruit_major_history"."update_time" IS '更新时间';
COMMENT
ON TABLE "public"."art_school_recruit_major_history" IS '院校招录专业历年录取数据';

-- ----------------------------
-- Table structure for art_school_tag
-- ----------------------------
DROP TABLE IF EXISTS "public"."art_school_tag";
CREATE TABLE "public"."art_school_tag"
(
    "school_tag_id" int8                                       NOT NULL GENERATED BY DEFAULT AS IDENTITY (
        INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1
),
    "tenant_id"     varchar(20) COLLATE "pg_catalog"."default" NOT NULL DEFAULT '000000'::character varying,
    "school_id"     int8                                       NOT NULL,
    "tag_name"      varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
    "create_dept"   int8,
    "create_by"     int8,
    "create_time"   timestamp(6),
    "update_by"     int8,
    "update_time"   timestamp(6),
    "del_flag"      char(1) COLLATE "pg_catalog"."default"     NOT NULL DEFAULT '0'::bpchar,
    "remark"        varchar(500) COLLATE "pg_catalog"."default"         DEFAULT NULL::character varying,
    "active_key"    int2 GENERATED ALWAYS AS (

        CASE
        WHEN (del_flag = '0'::bpchar) THEN 1
        ELSE NULL ::integer
END
) STORED
)
;
ALTER TABLE "public"."art_school_tag" OWNER TO "user_3W72AM";
COMMENT
ON COLUMN "public"."art_school_tag"."school_tag_id" IS '主键ID';
COMMENT
ON COLUMN "public"."art_school_tag"."tenant_id" IS '租户编号';
COMMENT
ON COLUMN "public"."art_school_tag"."school_id" IS '学校ID';
COMMENT
ON COLUMN "public"."art_school_tag"."tag_name" IS '标签名称';
COMMENT
ON COLUMN "public"."art_school_tag"."create_dept" IS '创建部门';
COMMENT
ON COLUMN "public"."art_school_tag"."create_by" IS '创建人';
COMMENT
ON COLUMN "public"."art_school_tag"."create_time" IS '创建时间';
COMMENT
ON COLUMN "public"."art_school_tag"."update_by" IS '更新人';
COMMENT
ON COLUMN "public"."art_school_tag"."update_time" IS '更新时间';
COMMENT
ON COLUMN "public"."art_school_tag"."del_flag" IS '删除标志（0存在 1删除）';
COMMENT
ON COLUMN "public"."art_school_tag"."remark" IS '备注';
COMMENT
ON COLUMN "public"."art_school_tag"."active_key" IS '仅用于唯一约束';
COMMENT
ON TABLE "public"."art_school_tag" IS '学校标签表';

-- ----------------------------
-- Indexes structure for table art_history_score_control_line
-- ----------------------------
CREATE INDEX "idx_control_tenant" ON "public"."art_history_score_control_line" USING btree (
    "tenant_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_control_year" ON "public"."art_history_score_control_line" USING btree (
    "year" "pg_catalog"."int2_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Uniques structure for table art_history_score_control_line
-- ----------------------------
ALTER TABLE "public"."art_history_score_control_line"
    ADD CONSTRAINT "uk_control_province_year" UNIQUE ("province_code", "year", "subject_type", "major_category",
                                                      "batch_name");

-- ----------------------------
-- Primary Key structure for table art_history_score_control_line
-- ----------------------------
ALTER TABLE "public"."art_history_score_control_line"
    ADD CONSTRAINT "art_history_score_control_line_pkey" PRIMARY KEY ("control_id");

-- ----------------------------
-- Indexes structure for table art_major
-- ----------------------------
CREATE INDEX "idx_major_level" ON "public"."art_major" USING btree (
    "education_level" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_major_tenant" ON "public"."art_major" USING btree (
    "tenant_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Uniques structure for table art_major
-- ----------------------------
ALTER TABLE "public"."art_major"
    ADD CONSTRAINT "uk_major_name_level" UNIQUE ("major_name", "education_level");

-- ----------------------------
-- Primary Key structure for table art_major
-- ----------------------------
ALTER TABLE "public"."art_major"
    ADD CONSTRAINT "art_major_pkey" PRIMARY KEY ("major_id");

-- ----------------------------
-- Indexes structure for table art_school
-- ----------------------------
CREATE INDEX "idx_main_name" ON "public"."art_school" USING btree (
    "main_name" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_school_level_nature" ON "public"."art_school" USING btree (
    "education_level" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
    "school_nature" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_school_region" ON "public"."art_school" USING btree (
    "province" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
    "city" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
    "district" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_school_type" ON "public"."art_school" USING btree (
    "university_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Uniques structure for table art_school
-- ----------------------------
ALTER TABLE "public"."art_school"
    ADD CONSTRAINT "uk_code" UNIQUE ("main_code");

-- ----------------------------
-- Primary Key structure for table art_school
-- ----------------------------
ALTER TABLE "public"."art_school"
    ADD CONSTRAINT "art_school_pkey" PRIMARY KEY ("school_id");

-- ----------------------------
-- Indexes structure for table art_school_campus
-- ----------------------------
CREATE INDEX "idx_campus_school_id" ON "public"."art_school_campus" USING btree (
    "school_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Uniques structure for table art_school_campus
-- ----------------------------
ALTER TABLE "public"."art_school_campus"
    ADD CONSTRAINT "uk_school_campus_name" UNIQUE ("school_id", "campus_name");

-- ----------------------------
-- Primary Key structure for table art_school_campus
-- ----------------------------
ALTER TABLE "public"."art_school_campus"
    ADD CONSTRAINT "art_school_campus_pkey" PRIMARY KEY ("campus_id");

-- ----------------------------
-- Indexes structure for table art_school_college
-- ----------------------------
CREATE INDEX "idx_college_school_id" ON "public"."art_school_college" USING btree (
    "school_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Uniques structure for table art_school_college
-- ----------------------------
ALTER TABLE "public"."art_school_college"
    ADD CONSTRAINT "uk_school_college_name" UNIQUE ("school_id", "college_name");

-- ----------------------------
-- Primary Key structure for table art_school_college
-- ----------------------------
ALTER TABLE "public"."art_school_college"
    ADD CONSTRAINT "art_school_college_pkey" PRIMARY KEY ("college_id");

-- ----------------------------
-- Indexes structure for table art_school_detail
-- ----------------------------
CREATE INDEX "idx_school_detail_school_id" ON "public"."art_school_detail" USING btree (
    "school_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_school_detail_tags" ON "public"."art_school_detail" USING gin (
    "tags" COLLATE "pg_catalog"."default" "pg_catalog"."array_ops"
    );

-- ----------------------------
-- Uniques structure for table art_school_detail
-- ----------------------------
ALTER TABLE "public"."art_school_detail"
    ADD CONSTRAINT "uk_school_id" UNIQUE ("school_id");

-- ----------------------------
-- Primary Key structure for table art_school_detail
-- ----------------------------
ALTER TABLE "public"."art_school_detail"
    ADD CONSTRAINT "art_school_detail_pkey" PRIMARY KEY ("detail_id");

-- ----------------------------
-- Indexes structure for table art_school_dorm
-- ----------------------------
CREATE INDEX "idx_dorm_campus_id" ON "public"."art_school_dorm" USING btree (
    "campus_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table art_school_dorm
-- ----------------------------
ALTER TABLE "public"."art_school_dorm"
    ADD CONSTRAINT "art_school_dorm_pkey" PRIMARY KEY ("dorm_id");

-- ----------------------------
-- Indexes structure for table art_school_enroll_code
-- ----------------------------
CREATE INDEX "idx_enroll_code" ON "public"."art_school_enroll_code" USING btree (
    "enroll_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Uniques structure for table art_school_enroll_code
-- ----------------------------
ALTER TABLE "public"."art_school_enroll_code"
    ADD CONSTRAINT "uk_school_code" UNIQUE ("school_id", "enroll_code");

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

-- ----------------------------
-- Indexes structure for table art_school_enroll_plan
-- ----------------------------
CREATE INDEX "idx_plan_school_year" ON "public"."art_school_enroll_plan" USING btree (
    "school_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
    "year" "pg_catalog"."int2_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_plan_year_province" ON "public"."art_school_enroll_plan" USING btree (
    "year" "pg_catalog"."int2_ops" ASC NULLS LAST,
    "province" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Uniques structure for table art_school_enroll_plan
-- ----------------------------
ALTER TABLE "public"."art_school_enroll_plan"
    ADD CONSTRAINT "uk_plan_unique" UNIQUE ("school_id", "year", "province", "subject_type", "major_name",
                                            "education_level");

-- ----------------------------
-- Primary Key structure for table art_school_enroll_plan
-- ----------------------------
ALTER TABLE "public"."art_school_enroll_plan"
    ADD CONSTRAINT "art_school_enroll_plan_pkey" PRIMARY KEY ("plan_id");

-- ----------------------------
-- Indexes structure for table art_school_major
-- ----------------------------
CREATE INDEX "idx_major_college_id" ON "public"."art_school_major" USING btree (
    "college_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_major_school_id" ON "public"."art_school_major" USING btree (
    "school_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Uniques structure for table art_school_major
-- ----------------------------
ALTER TABLE "public"."art_school_major"
    ADD CONSTRAINT "uk_college_major_name" UNIQUE ("college_id", "major_name");

-- ----------------------------
-- Primary Key structure for table art_school_major
-- ----------------------------
ALTER TABLE "public"."art_school_major"
    ADD CONSTRAINT "art_school_major_pkey" PRIMARY KEY ("school_major_id");

-- ----------------------------
-- Indexes structure for table art_school_major_tag
-- ----------------------------
CREATE INDEX "idx_major_tag_filter" ON "public"."art_school_major_tag" USING btree (
    "tenant_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
    "del_flag" COLLATE "pg_catalog"."default" "pg_catalog"."bpchar_ops" ASC NULLS LAST,
    "tag_name" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
    "major_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_major_tag_major" ON "public"."art_school_major_tag" USING btree (
    "tenant_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
    "del_flag" COLLATE "pg_catalog"."default" "pg_catalog"."bpchar_ops" ASC NULLS LAST,
    "major_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Uniques structure for table art_school_major_tag
-- ----------------------------
ALTER TABLE "public"."art_school_major_tag"
    ADD CONSTRAINT "uk_major_tag_active" UNIQUE ("tenant_id", "major_id", "tag_name", "active_key");

-- ----------------------------
-- Primary Key structure for table art_school_major_tag
-- ----------------------------
ALTER TABLE "public"."art_school_major_tag"
    ADD CONSTRAINT "art_school_major_tag_pkey" PRIMARY KEY ("major_tag_id");

-- ----------------------------
-- Indexes structure for table art_school_media
-- ----------------------------
CREATE INDEX "idx_media_biz" ON "public"."art_school_media" USING btree (
    "biz_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
    "biz_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_media_type" ON "public"."art_school_media" USING btree (
    "media_type" "pg_catalog"."int2_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table art_school_media
-- ----------------------------
ALTER TABLE "public"."art_school_media"
    ADD CONSTRAINT "art_school_media_pkey" PRIMARY KEY ("media_id");

-- ----------------------------
-- Indexes structure for table art_school_name
-- ----------------------------
CREATE INDEX "idx_name" ON "public"."art_school_name" USING btree (
    "name" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_school_name_id" ON "public"."art_school_name" USING btree (
    "school_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table art_school_name
-- ----------------------------
ALTER TABLE "public"."art_school_name"
    ADD CONSTRAINT "art_school_name_pkey" PRIMARY KEY ("school_name_id");

-- ----------------------------
-- Indexes structure for table art_school_recruit_major
-- ----------------------------
CREATE INDEX "idx_recruit_major_code" ON "public"."art_school_recruit_major" USING btree (
    "major_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
    "year" "pg_catalog"."int2_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_recruit_school_code" ON "public"."art_school_recruit_major" USING btree (
    "school_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
    "year" "pg_catalog"."int2_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_recruit_tenant" ON "public"."art_school_recruit_major" USING btree (
    "tenant_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Uniques structure for table art_school_recruit_major
-- ----------------------------
ALTER TABLE "public"."art_school_recruit_major"
    ADD CONSTRAINT "uk_recruit_school_year" UNIQUE ("school_id", "year", "major_code", "enroll_code");

-- ----------------------------
-- Primary Key structure for table art_school_recruit_major
-- ----------------------------
ALTER TABLE "public"."art_school_recruit_major"
    ADD CONSTRAINT "art_school_recruit_major_pkey" PRIMARY KEY ("recruit_major_id");

-- ----------------------------
-- Indexes structure for table art_school_recruit_major_history
-- ----------------------------
CREATE INDEX "idx_history_recruit_year" ON "public"."art_school_recruit_major_history" USING btree (
    "recruit_major_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
    "year" "pg_catalog"."int2_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_history_school_year" ON "public"."art_school_recruit_major_history" USING btree (
    "school_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
    "year" "pg_catalog"."int2_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_history_subject_batch" ON "public"."art_school_recruit_major_history" USING btree (
    "subject_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
    "batch_name" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_history_tenant" ON "public"."art_school_recruit_major_history" USING btree (
    "tenant_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table art_school_recruit_major_history
-- ----------------------------
ALTER TABLE "public"."art_school_recruit_major_history"
    ADD CONSTRAINT "art_school_recruit_major_history_pkey" PRIMARY KEY ("history_id");

-- ----------------------------
-- Indexes structure for table art_school_tag
-- ----------------------------
CREATE INDEX "idx_school_tag_filter" ON "public"."art_school_tag" USING btree (
    "tenant_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
    "del_flag" COLLATE "pg_catalog"."default" "pg_catalog"."bpchar_ops" ASC NULLS LAST,
    "tag_name" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
    "school_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_school_tag_school" ON "public"."art_school_tag" USING btree (
    "tenant_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
    "del_flag" COLLATE "pg_catalog"."default" "pg_catalog"."bpchar_ops" ASC NULLS LAST,
    "school_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Uniques structure for table art_school_tag
-- ----------------------------
ALTER TABLE "public"."art_school_tag"
    ADD CONSTRAINT "uk_school_tag_active" UNIQUE ("tenant_id", "school_id", "tag_name", "active_key");

-- ----------------------------
-- Primary Key structure for table art_school_tag
-- ----------------------------
ALTER TABLE "public"."art_school_tag"
    ADD CONSTRAINT "art_school_tag_pkey" PRIMARY KEY ("school_tag_id");

-- ----------------------------
-- Foreign Keys structure for table art_school_recruit_major_history
-- ----------------------------
ALTER TABLE "public"."art_school_recruit_major_history"
    ADD CONSTRAINT "fk_history_recruit" FOREIGN KEY ("recruit_major_id") REFERENCES "public"."art_school_recruit_major" ("recruit_major_id") ON DELETE NO ACTION ON UPDATE NO ACTION;
