2018-02-12 17:29:03 +01:00
|
|
|
-- +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,
|
2018-02-12 17:29:03 +01:00
|
|
|
`summary` JSON,
|
|
|
|
`done` TINYINT(1),
|
2018-05-03 18:40:52 +02:00
|
|
|
`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
|
2018-02-12 17:29:03 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
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,
|
2018-02-12 17:29:03 +01:00
|
|
|
`summary` JSON,
|
|
|
|
`ip` VARCHAR(255),
|
2018-03-19 19:28:22 +01:00
|
|
|
`asn` VARCHAR(16),
|
2018-02-12 17:29:03 +01:00
|
|
|
`country` VARCHAR(2),
|
2018-02-13 17:11:22 +01:00
|
|
|
`network_name` VARCHAR(255),
|
2018-02-12 17:29:03 +01:00
|
|
|
`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),
|
2018-02-12 17:29:03 +01:00
|
|
|
`input` VARCHAR(255),
|
2018-02-13 17:11:22 +01:00
|
|
|
`result_id` INTEGER REFERENCES `results` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
|
2018-02-12 17:29:03 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
-- +migrate StatementEnd
|