ooni-probe-cli/data/migrations/1_create_msmt_results.sql

47 lines
1.1 KiB
MySQL
Raw Normal View History

-- +migrate Down
-- +migrate StatementBegin
DROP TABLE `results`;
DROP TABLE `measurements`;
-- +migrate StatementEnd
-- +migrate Up
-- +migrate StatementBegin
CREATE TABLE `results` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` VARCHAR(255),
2018-02-13 17:11:22 +01:00
`start_time` DATETIME,
2018-03-20 12:38:21 +01:00
`runtime` REAL,
`summary` JSON,
`done` TINYINT(1),
`country` VARCHAR(2),
`asn` VARCHAR(16),
`network_name` VARCHAR(255),
2018-02-13 17:11:22 +01:00
`data_usage_up` INTEGER,
`data_usage_down` INTEGER
);
CREATE TABLE `measurements` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` VARCHAR(255),
2018-02-13 17:11:22 +01:00
`start_time` DATETIME,
2018-03-20 12:38:21 +01:00
`runtime` REAL,
`summary` JSON,
`ip` VARCHAR(255),
2018-03-19 19:28:22 +01:00
`asn` VARCHAR(16),
`country` VARCHAR(2),
2018-02-13 17:11:22 +01:00
`network_name` VARCHAR(255),
`state` TEXT,
`failure` VARCHAR(255),
2018-03-19 19:28:22 +01:00
`upload_failure` VARCHAR(255),
`uploaded` TINYINT(1),
2018-02-13 17:11:22 +01:00
`report_file` VARCHAR(255),
`report_id` VARCHAR(255),
`input` VARCHAR(255),
2018-02-13 17:11:22 +01:00
`result_id` INTEGER REFERENCES `results` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
);
-- +migrate StatementEnd