summaryrefslogtreecommitdiffstats
path: root/db/knex_migrations/2023-12-21-0000-stat-ping-min-max.js
blob: d936ce56c820f411cdfbcea7b33ba607d91529b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
exports.up = function (knex) {
    return knex.schema
        .alterTable("stat_daily", function (table) {
            table.float("ping_min").notNullable().defaultTo(0).comment("Minimum ping during this period in milliseconds");
            table.float("ping_max").notNullable().defaultTo(0).comment("Maximum ping during this period in milliseconds");
        })
        .alterTable("stat_minutely", function (table) {
            table.float("ping_min").notNullable().defaultTo(0).comment("Minimum ping during this period in milliseconds");
            table.float("ping_max").notNullable().defaultTo(0).comment("Maximum ping during this period in milliseconds");
        });

};

exports.down = function (knex) {
    return knex.schema
        .alterTable("stat_daily", function (table) {
            table.dropColumn("ping_min");
            table.dropColumn("ping_max");
        })
        .alterTable("stat_minutely", function (table) {
            table.dropColumn("ping_min");
            table.dropColumn("ping_max");
        });
};