-- ----------------------------
-- Sequence structure for tbl_region_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."tbl_region_id_seq";
CREATE SEQUENCE "public"."tbl_region_id_seq"
    INCREMENT 1
    MINVALUE  1
    MAXVALUE 9223372036854775807
    START 1
    CACHE 1;
ALTER SEQUENCE "public"."tbl_region_id_seq" OWNER TO "postgres";


-- ----------------------------
-- Table structure for tbl_region
-- ----------------------------
DROP TABLE IF EXISTS "public"."tbl_region";
CREATE TABLE "public"."tbl_region" (
   "id" int8 NOT NULL DEFAULT nextval('tbl_region_id_seq'::regclass),
   "create_by" varchar(255) COLLATE "pg_catalog"."default",
   "create_time" timestamp(0),
   "delete_flag" bool,
   "update_by" varchar(255) COLLATE "pg_catalog"."default",
   "update_time" timestamp(0),
   "create_by_name" varchar(255) COLLATE "pg_catalog"."default",
   "update_by_name" varchar(255) COLLATE "pg_catalog"."default",
   "ad_code" varchar(255) COLLATE "pg_catalog"."default",
   "center" varchar(255) COLLATE "pg_catalog"."default",
   "city_code" varchar(255) COLLATE "pg_catalog"."default",
   "level" varchar(255) COLLATE "pg_catalog"."default",
   "name" varchar(255) COLLATE "pg_catalog"."default",
   "parent_id" int8,
   "path" varchar(255) COLLATE "pg_catalog"."default",
   "order_num" int2
)
;
ALTER TABLE "public"."tbl_region" OWNER TO "postgres";
COMMENT ON COLUMN "public"."tbl_region"."create_by" IS '创建者';
COMMENT ON COLUMN "public"."tbl_region"."create_time" IS '创建时间';
COMMENT ON COLUMN "public"."tbl_region"."delete_flag" IS '删除标志 true/false 删除/未删除';
COMMENT ON COLUMN "public"."tbl_region"."update_by" IS '更新者';
COMMENT ON COLUMN "public"."tbl_region"."update_time" IS '更新时间';
COMMENT ON COLUMN "public"."tbl_region"."create_by_name" IS '创建用户姓名';
COMMENT ON COLUMN "public"."tbl_region"."update_by_name" IS '修改用户姓名';
COMMENT ON COLUMN "public"."tbl_region"."ad_code" IS '区域编码';
COMMENT ON COLUMN "public"."tbl_region"."center" IS '区域中心点经纬度';
COMMENT ON COLUMN "public"."tbl_region"."city_code" IS '城市代码';
COMMENT ON COLUMN "public"."tbl_region"."level" IS '行政区划级别';
COMMENT ON COLUMN "public"."tbl_region"."name" IS '名称';
COMMENT ON COLUMN "public"."tbl_region"."parent_id" IS '父ID';
COMMENT ON COLUMN "public"."tbl_region"."path" IS '行政地区路径';
COMMENT ON COLUMN "public"."tbl_region"."order_num" IS '排序';

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."tbl_region_id_seq"
    OWNED BY "public"."tbl_region"."id";
SELECT setval('"public"."tbl_region_id_seq"', 9826990706, false);

-- ----------------------------
-- Indexes structure for table tbl_region
-- ----------------------------
CREATE INDEX "tbl_region_ad_code_idx" ON "public"."tbl_region" USING btree (
    "ad_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "tbl_region_city_code_idx" ON "public"."tbl_region" USING btree (
    "city_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "tbl_region_level_idx" ON "public"."tbl_region" USING btree (
    "level" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "tbl_region_parent_id_idx" ON "public"."tbl_region" USING btree (
    "parent_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

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

SELECT setval('"public"."tbl_region_id_seq"', 9826990706, false);
