new limit journal test and necessary tweaks (#606)

This commit is contained in:
Michael Quigley
2024-05-31 15:18:07 -04:00
parent d2d3adc5cc
commit b3f10dadec
4 changed files with 70 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
-- +migrate Up
create table limit_classes (
id serial primary key,
id integer primary key,
limit_scope string not null default ('account'),
limit_action string not null default ('limit'),
@@ -23,7 +23,7 @@ create table limit_classes (
);
create table applied_limit_classes (
id serial primary key,
id integer primary key,
account_id integer not null references accounts (id),
limit_class_id integer not null references limit_classes (id),
created_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')),

View File

@@ -5,14 +5,14 @@ drop table environment_limit_journal;
drop table share_limit_journal;
create table bandwidth_limit_journal (
id serial primary key,
id integer primary key,
account_id integer references accounts (id) not null,
limit_class integer references limit_classes,
limit_class_id integer references limit_classes,
action string not null,
rx_bytes bigint not null,
tx_bytes bigint not null,
created_at timestamptz not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')),
updated_at timestamptz not null default(strftime('%Y-%m-%d %H:%M:%f', 'now'))
created_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')),
updated_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now'))
);
create index bandwidth_limit_journal_account_id_idx on bandwidth_limit_journal (account_id);