Files
mctf/dark-tariff/backend/database/sql/schema/billing.sql
T
TakuyaYagam1 13f936bee9 chore: import MCTF services
- Added all seven issued service trees without omissions.
- Preserved the supplied runtime configuration, binaries, and assets.
2026-11-29 12:25:29 +03:00

23 lines
776 B
SQL
Executable File

create extension if not exists pgcrypto;
create schema if not exists billing;
create table if not exists billing.reading (
id bigserial primary key,
serial text not null check (btrim(serial) <> '' and length(serial) <= 128),
kind text not null,
metrics jsonb not null check (jsonb_typeof(metrics) = 'object'),
created_at timestamptz not null default now(),
n integer not null,
h bit varying[] not null,
y bit varying not null,
w integer not null,
parameters text not null
);
create index if not exists reading_created_at_idx
on billing.reading (created_at);
create unique index if not exists reading_parameters_uniq
on billing.reading (digest(parameters, 'sha256'));