summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-server/src/main/resources/db/testing/V3.0.1__entities.sql
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2023-02-03 18:32:34 +0000
committerGitHub <noreply@github.com>2023-02-03 18:32:34 +0000
commitbb5e9e7778f6e7cc2161a988fef177d28df8d64f (patch)
tree3085bdbc0899c7269e286ce026982c02a3a2864e /opendc-web/opendc-web-server/src/main/resources/db/testing/V3.0.1__entities.sql
parentdd9b7b1e0c59c010fb191a1ea1d805f2748fb216 (diff)
parent49b3015a16287bb4486aa64c5c26f05f7c22089c (diff)
merge: Clean up web server (#130)
This pull request cleans up the web server to follow Quarkus' best-practices. ## Implementation Notes :hammer_and_pick: * Migrate to Hypersistence Utils * Convert web server utils to Java * Use Panache for entity modeling * Convert resources to Java * Remove unnecessary service indirections ## External Dependencies :four_leaf_clover: * Panache for modeling database entities * Hypersistence Utils for storing JSON in database * Mockito for mocking in the web server tests ## Breaking API Changes :warning: * All implementation is moved to Java for better compatibility with Quarkus. * Scenarios can now have multiple jobs (e.g., if retried)
Diffstat (limited to 'opendc-web/opendc-web-server/src/main/resources/db/testing/V3.0.1__entities.sql')
-rw-r--r--opendc-web/opendc-web-server/src/main/resources/db/testing/V3.0.1__entities.sql24
1 files changed, 24 insertions, 0 deletions
diff --git a/opendc-web/opendc-web-server/src/main/resources/db/testing/V3.0.1__entities.sql b/opendc-web/opendc-web-server/src/main/resources/db/testing/V3.0.1__entities.sql
new file mode 100644
index 00000000..1b702f4e
--- /dev/null
+++ b/opendc-web/opendc-web-server/src/main/resources/db/testing/V3.0.1__entities.sql
@@ -0,0 +1,24 @@
+-- Test entities
+
+alter sequence hibernate_sequence restart with 500;
+
+insert into projects (id, created_at, name, portfolios_created, scenarios_created, topologies_created, updated_at)
+values (1, current_timestamp(), 'Test Project', 1, 2, 1, current_timestamp());
+insert into project_authorizations (project_id, user_id, role)
+values (1, 'owner', 'OWNER'),
+ (1, 'editor', 'EDITOR'),
+ (1, 'viewer', 'VIEWER');
+
+insert into portfolios (id, name, number, targets, project_id)
+values (1, 'Test Portfolio', 1, '{ "metrics": [] }' format json, 1);
+
+insert into topologies (id, created_at, name, number, rooms, updated_at, project_id)
+values (1, current_timestamp(), 'Test Topology', 1, '[]' format json, current_timestamp(), 1);
+
+insert into scenarios (id, name, number, phenomena, scheduler_name, sampling_fraction, portfolio_id, project_id, topology_id, trace_id)
+values (1, 'Test Scenario', 1, '{ "failures": false, "interference": false }' format json, 'mem', 1.0, 1, 1, 1, 'bitbrains-small'),
+ (2, 'Test Scenario', 2, '{ "failures": false, "interference": false }' format json, 'mem', 1.0, 1, 1, 1, 'bitbrains-small');
+
+insert into jobs (id, created_by, created_at, repeats, updated_at, scenario_id)
+values (1, 'owner', current_timestamp(), 1, current_timestamp(), 1),
+ (2, 'owner', current_timestamp(), 1, current_timestamp(), 2);