summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-server/src/main/resources/db
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-10-06 22:42:31 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-10-10 11:54:51 +0200
commit5b8dfc78496452bd23fab59e3ead84a8941da779 (patch)
treef45c9c7ccb367bcb291edf535fba0981b104933b /opendc-web/opendc-web-server/src/main/resources/db
parent5c05d729b83dfc367bf19e8559569030f6e400b3 (diff)
feat(web/server): Add support for accounting simulation time
This change updates the Quarkus-based web server to add support for tracking and limiting the simulation minutes used by the user in order to prevent misuse of shared resources.
Diffstat (limited to 'opendc-web/opendc-web-server/src/main/resources/db')
-rw-r--r--opendc-web/opendc-web-server/src/main/resources/db/migration/V1.0.0__core.sql22
1 files changed, 17 insertions, 5 deletions
diff --git a/opendc-web/opendc-web-server/src/main/resources/db/migration/V1.0.0__core.sql b/opendc-web/opendc-web-server/src/main/resources/db/migration/V1.0.0__core.sql
index 183a70ea..1a0e4046 100644
--- a/opendc-web/opendc-web-server/src/main/resources/db/migration/V1.0.0__core.sql
+++ b/opendc-web/opendc-web-server/src/main/resources/db/migration/V1.0.0__core.sql
@@ -65,15 +65,27 @@ create table scenarios
create table jobs
(
- id bigint not null,
- created_at timestamp not null,
- repeats integer not null,
+ id bigint not null,
+ created_by varchar(255) not null,
+ created_at timestamp not null,
+ repeats integer not null,
results jsonb,
- state integer not null,
- updated_at timestamp not null,
+ state integer not null,
+ runtime integer not null,
+ updated_at timestamp not null,
primary key (id)
);
+-- User accounting
+create table user_accounting
+(
+ user_id varchar(255) not null,
+ period_end date not null,
+ simulation_time integer not null,
+ simulation_time_budget integer not null,
+ primary key (user_id)
+);
+
-- Workload traces available to the user.
create table traces
(