init.sql
4.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
-- 字幕集表
create table if not exists caption_set
(
id int8 not null primary key AUTO_INCREMENT,
unid varchar(36) not null default RANDOM_UUID(),
name varchar(128) not null,
intro text,
create_time timestamp not null default current_timestamp
);
comment on table caption_set is '字幕集表,每行数据对应多个字幕数据';
comment on column caption_set.name is '名称';
comment on column caption_set.intro is '描述';
comment on column caption_set.create_time is '创建时间';
create index if not exists caption_set_unid_idx on caption_set (unid);
-- 字幕表
create table if not exists caption
(
id int8 not null primary key AUTO_INCREMENT,
unid varchar(36) not null default RANDOM_UUID(),
caption_set_id int8 not null,
enabled boolean not null default true,
pic_type int4,
bg_color int4,
bg_transparency int4 not null default 100,
font int4,
font_size int4,
fg_color int4,
date_format varchar(64),
millisecond boolean not null default false,
position_type int4 not null default 0,
x varchar(64) not null default 0,
y varchar(64) not null default 0,
context text,
create_time timestamp not null default current_timestamp,
foreign key (caption_set_id) references caption_set (id) on delete cascade on update no action
);
comment on table caption is '字幕表';
comment on column caption.caption_set_id is '字幕集ID';
comment on column caption.enabled is '是否启用文字叠加';
comment on column caption.pic_type is '图片类型:全景图,车辆特写,人脸特写等';
comment on column caption.bg_color is '背景颜色';
comment on column caption.bg_transparency is '背景颜色透明度';
comment on column caption.font is '字体';
comment on column caption.font_size is '字体大小';
comment on column caption.fg_color is '字体颜色';
comment on column caption.date_format is '日期格式';
comment on column caption.position_type is '坐标类型,0外上边缘,1外下边缘,2内上边缘,3内下边缘,4自定义';
comment on column caption.x is '字幕相对图片的x坐标';
comment on column caption.y is '字幕相对图片的y坐标';
comment on column caption.context is '叠加信息(JSON)';
create index if not exists caption_caption_set_id_idx on caption (caption_set_id);
create index if not exists caption_unid_idx on caption (unid);
-- 图片合成配置表
create table if not exists pic_config
(
id int8 not null primary key AUTO_INCREMENT,
unid varchar(36) not null default RANDOM_UUID(),
name varchar(128) not null,
enabled boolean not null default true,
caption_set_id int8,
picture_quality int4,
type int4,
context text,
create_time timestamp not null default current_timestamp,
foreign key (caption_set_id) references caption_set (id) on delete set null on update no action
);
comment on table pic_config is '图片合成配置表';
comment on column pic_config.name is '名称';
comment on column pic_config.enabled is '是否启用图片合成';
comment on column pic_config.caption_set_id is '对应字幕集';
comment on column pic_config.picture_quality is '图片质量,KB';
comment on column pic_config.type is '图片排列类型';
comment on column pic_config.context is '排列方式(JSON)';
comment on column pic_config.create_time is '创建时间';
create index if not exists pic_config_caption_set_id_idx on pic_config (caption_set_id);
create index if not exists pic_config_unid_idx on pic_config (unid);
-- 存储方案表
create table if not exists storage_config
(
id int8 not null primary key AUTO_INCREMENT,
unid varchar(36) not null default RANDOM_UUID(),
name varchar(128) not null,
type int4 not null default 0,
context text,
config MEDIUMBLOB,
create_time timestamp not null default current_timestamp
);
comment on table storage_config is '存储方案表';
comment on column storage_config.name is '名称';
comment on column storage_config.context is '关联(JSON)';
comment on column storage_config.config is '生成或上传的存储配置';
comment on column storage_config.create_time is '创建时间';
comment on column storage_config.type is '类型,0代表页面创建的,1代表上传的';
create index if not exists storage_config_unid_idx on storage_config (unid);