-
Notifications
You must be signed in to change notification settings - Fork 9
/
init.sql
33 lines (31 loc) · 1.03 KB
/
init.sql
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
CREATE TABLE `api_credential` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`provider` INT NOT NULL,
`key` VARCHAR(255) NOT NULL,
`value` VARCHAR(1024) NOT NULL,
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE(`provider`, `key`)
);
CREATE TABLE `model_answer` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`question_hash` CHAR(64) NOT NULL,
`question` TEXT NOT NULL,
`model` INT NOT NULL,
`scenario` INT,
`answer` TEXT NOT NULL,
`rating` TINYINT UNSIGNED,
`comment` TEXT,
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
INDEX(`question_hash`, `model`),
INDEX(`scenario`)
);
CREATE TABLE `model_evaluation` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`provider` INT NOT NULL,
`model` INT NOT NULL,
`scenario_id` INT NOT NULL,
`rating` TINYINT UNSIGNED NOT NULL,
`comment` TEXT,
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
INDEX(`provider`, `model_name`, `scenario_id`)
);