mirror of
https://github.com/openziti/zrok.git
synced 2025-01-08 23:20:04 +01:00
applied_limit_classes (#606)
This commit is contained in:
parent
1238c4981c
commit
4d67598acb
@ -3,7 +3,7 @@
|
||||
create type limit_scope as enum ('account', 'environment', 'share');
|
||||
create type limit_action as enum ('warning', 'limit');
|
||||
|
||||
create table limits_classes (
|
||||
create table limit_classes (
|
||||
id serial primary key,
|
||||
limit_scope limit_scope not null default ('account'),
|
||||
limit_action limit_action not null default ('limit'),
|
||||
@ -16,4 +16,13 @@ create table limits_classes (
|
||||
created_at timestamptz not null default(current_timestamp),
|
||||
updated_at timestamptz not null default(current_timestamp),
|
||||
deleted boolean not null default(false)
|
||||
)
|
||||
);
|
||||
|
||||
create table applied_limit_classes (
|
||||
id serial primary key,
|
||||
account_id integer not null references accounts (id),
|
||||
limit_class_id integer not null references limit_classes (id),
|
||||
created_at timestamptz not null default(current_timestamp),
|
||||
updated_at timestamptz not null default(current_timestamp),
|
||||
deleted boolean not null default(false)
|
||||
);
|
@ -1,16 +1,25 @@
|
||||
-- +migrate Up
|
||||
|
||||
create table limits_classes (
|
||||
create table limit_classes (
|
||||
id serial primary key,
|
||||
limit_scope string not null default ('account'),
|
||||
limit_action string not null default ('limit'),
|
||||
share_mode string,
|
||||
backend_mode string,
|
||||
period_minutes int not null default (1440),
|
||||
period_minutes integer not null default (1440),
|
||||
rx_bytes bigint not null default (-1),
|
||||
tx_bytes bigint not null default (-1),
|
||||
total_bytes bigint not null default (-1),
|
||||
created_at timestamptz not null default(current_timestamp),
|
||||
updated_at timestamptz not null default(current_timestamp),
|
||||
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')),
|
||||
deleted boolean not null default(false)
|
||||
)
|
||||
);
|
||||
|
||||
create table applied_limit_classes (
|
||||
id serial 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')),
|
||||
updated_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')),
|
||||
deleted boolean not null default(false)
|
||||
);
|
Loading…
Reference in New Issue
Block a user