document-store-lib-postgresql/src/test/resources/StorageUsageRecordTable.sql

21 lines
841 B
MySQL
Raw Normal View History

2021-03-15 11:38:19 +01:00
-- CREATE TYPE operation_result AS ENUM ('SUCCESS', 'FAILED');
2021-03-15 11:56:13 +01:00
CREATE TYPE operation_type AS ENUM ('CREATE', 'READ', 'UPDATE', 'DELETE');
CREATE TYPE data_type AS ENUM ('STORAGE', 'TREE', 'GEO', 'DATABASE', 'LOCAL', 'OTHER');
2021-03-15 11:38:19 +01:00
CREATE TABLE "storageusagerecord"(
2021-03-15 16:14:04 +01:00
id UUID NOT NULL PRIMARY KEY,
2021-03-12 19:13:57 +01:00
consumer_id TEXT NOT NULL,
creation_time TIMESTAMP WITH TIME ZONE NOT NULL,
scope TEXT NOT NULL,
operation_result operation_result NOT NULL,
resource_owner TEXT NOT NULL,
resource_scope TEXT NOT NULL,
resource_uri TEXT NOT NULL,
provider_uri TEXT NOT NULL,
operation_type operation_type NOT NULL,
data_type data_type NOT NULL,
2021-03-15 11:44:19 +01:00
data_volume NUMERIC NOT NULL,
operation_count INTEGER NOT NULL DEFAULT 1,
aggregated BOOLEAN NOT NULL DEFAULT true,
start_time TIMESTAMP WITH TIME ZONE NOT NULL,
end_time TIMESTAMP WITH TIME ZONE NOT NULL
2021-03-15 11:38:19 +01:00
);