liding
4 天以前 a461d5fc184fd0129a0eb5a5b3e34f67d75cc6a2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
DROP TABLE IF EXISTS district;
 
CREATE TABLE district
(
    id          bigserial PRIMARY KEY,
    create_time timestamp with time zone NOT NULL,
    update_time timestamp with time zone NOT NULL,
    name        varchar(100) DEFAULT ''  NOT NULL,
    city_id     bigint       DEFAULT 0   NOT NULL
);
 
COMMENT ON TABLE district IS '区表';
 
COMMENT ON COLUMN district.name IS '名称';
COMMENT ON COLUMN district.city_id IS '城市id';
 
create unique index on district (name, city_id);