Skip to content

Commit 00c97cc

Browse files
authored
Merge pull request #526 from kitsudaiki/feat/update-database-schemas
related issue: #525
2 parents f21d89e + 4fbcd2b commit 00c97cc

55 files changed

Lines changed: 414 additions & 173 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
- removed the Binary input option again
1010
- functions of the python-sdk now returning a dict instead of a json-formated string
11+
- added `created_by`, `updated_at`, `updated_by` and `deleted_by` to all endpoints, where the database was updated
1112

1213
#### Checkpoint-breaking
1314

@@ -26,6 +27,8 @@
2627

2728
- Added `task_uuid` to datasets
2829
- Datasets, which are created as result form request-task, have now a random uuid instead of the uuid of the initial request-task
30+
- replaced the old `creator_id` for users and projects
31+
- added `created_by`, `updated_at`, `updated_by` and `deleted_by` to all relevant database-tables
2932

3033
### Added
3134

src/hanami/src/api/endpoint_processing/auth_check.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ validateToken(json& result,
9090
result.erase("iat");
9191
result.erase("nbf");
9292
result.erase("created_at");
93+
result.erase("created_by");
94+
result.erase("updated_at");
95+
result.erase("updated_by");
9396

9497
return true;
9598
}

src/hanami/src/api/http/checkpoint/get_checkpoint_v1_0.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ GetCheckpointV1M0::GetCheckpointV1M0() : Blossom("Get checkpoint of a cluster.")
4747

4848
registerOutputField("location", SAKURA_STRING_TYPE).setComment("File path on local storage.");
4949

50+
registerOutputField("created_at", SAKURA_STRING_TYPE)
51+
.setComment("Timestamp, when resource was created.");
52+
53+
registerOutputField("created_by", SAKURA_STRING_TYPE)
54+
.setComment("ID of the user, who created the resource.");
55+
56+
registerOutputField("updated_at", SAKURA_STRING_TYPE)
57+
.setComment("Timestamp, when resource was updated.");
58+
59+
registerOutputField("updated_by", SAKURA_STRING_TYPE)
60+
.setComment("ID of the user, who updated the resource.");
61+
5062
//----------------------------------------------------------------------------------------------
5163
//
5264
//----------------------------------------------------------------------------------------------

src/hanami/src/api/http/checkpoint/list_checkpoint_v1_0.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ ListCheckpointV1M0::ListCheckpointV1M0() : Blossom("List checkpoints of all visi
3333

3434
json headerMatch = json::array();
3535
headerMatch.push_back("created_at");
36+
headerMatch.push_back("created_by");
37+
headerMatch.push_back("updated_at");
38+
headerMatch.push_back("updated_by");
3639
headerMatch.push_back("uuid");
3740
headerMatch.push_back("project_id");
3841
headerMatch.push_back("owner_id");

src/hanami/src/api/http/cluster/create_cluster_v1_0.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ CreateClusterV1M0::CreateClusterV1M0() : Blossom("Create new cluster.")
5151
// output
5252
//----------------------------------------------------------------------------------------------
5353

54-
registerOutputField("created_at", SAKURA_STRING_TYPE)
55-
.setComment("Timestamp, when cluster was created.");
56-
5754
registerOutputField("uuid", SAKURA_STRING_TYPE).setComment("UUID of the new created cluster.");
5855

5956
registerOutputField("name", SAKURA_STRING_TYPE).setComment("Name of the new created cluster.");
@@ -67,6 +64,18 @@ CreateClusterV1M0::CreateClusterV1M0() : Blossom("Create new cluster.")
6764
registerOutputField("visibility", SAKURA_STRING_TYPE)
6865
.setComment("Visibility of the new created cluster (private, shared, public).");
6966

67+
registerOutputField("created_at", SAKURA_STRING_TYPE)
68+
.setComment("Timestamp, when resource was created.");
69+
70+
registerOutputField("created_by", SAKURA_STRING_TYPE)
71+
.setComment("ID of the user, who created the resource.");
72+
73+
registerOutputField("updated_at", SAKURA_STRING_TYPE)
74+
.setComment("Timestamp, when resource was updated.");
75+
76+
registerOutputField("updated_by", SAKURA_STRING_TYPE)
77+
.setComment("ID of the user, who updated the resource.");
78+
7079
//----------------------------------------------------------------------------------------------
7180
//
7281
//----------------------------------------------------------------------------------------------

src/hanami/src/api/http/cluster/list_cluster_v1_0.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ ListClusterV1M0::ListClusterV1M0() : Blossom("List all visible clusters.")
3333

3434
json headerMatch = json::array();
3535
headerMatch.push_back("created_at");
36+
headerMatch.push_back("created_by");
37+
headerMatch.push_back("updated_at");
38+
headerMatch.push_back("updated_by");
3639
headerMatch.push_back("uuid");
3740
headerMatch.push_back("project_id");
3841
headerMatch.push_back("owner_id");

src/hanami/src/api/http/cluster/set_cluster_mode_v1_0.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,25 @@ SetClusterModeV1M0::SetClusterModeV1M0() : Blossom("Set mode of the cluster.")
5353
// output
5454
//----------------------------------------------------------------------------------------------
5555

56-
registerOutputField("created_at", SAKURA_STRING_TYPE)
57-
.setComment("Timestamp, when cluster was created.");
58-
5956
registerOutputField("uuid", SAKURA_STRING_TYPE).setComment("UUID of the cluster.");
6057

6158
registerOutputField("name", SAKURA_STRING_TYPE).setComment("Name of the cluster.");
6259

6360
registerOutputField("new_state", SAKURA_STRING_TYPE)
6461
.setComment("New desired state for the cluster.");
6562

63+
registerOutputField("created_at", SAKURA_STRING_TYPE)
64+
.setComment("Timestamp, when resource was created.");
65+
66+
registerOutputField("created_by", SAKURA_STRING_TYPE)
67+
.setComment("ID of the user, who created the resource.");
68+
69+
registerOutputField("updated_at", SAKURA_STRING_TYPE)
70+
.setComment("Timestamp, when resource was updated.");
71+
72+
registerOutputField("updated_by", SAKURA_STRING_TYPE)
73+
.setComment("ID of the user, who updated the resource.");
74+
6675
//----------------------------------------------------------------------------------------------
6776
//
6877
//----------------------------------------------------------------------------------------------

src/hanami/src/api/http/cluster/show_cluster_v1_0.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ ShowClusterV1M0::ShowClusterV1M0() : Blossom("Show information of a specific clu
4343
// output
4444
//----------------------------------------------------------------------------------------------
4545

46-
registerOutputField("created_at", SAKURA_STRING_TYPE)
47-
.setComment("Timestamp, when cluster was created.");
48-
4946
registerOutputField("uuid", SAKURA_STRING_TYPE).setComment("UUID of the cluster.");
5047

5148
registerOutputField("name", SAKURA_STRING_TYPE).setComment("Name of the cluster.");
@@ -65,6 +62,18 @@ ShowClusterV1M0::ShowClusterV1M0() : Blossom("Show information of a specific clu
6562
registerOutputField("number_of_sections", SAKURA_INT_TYPE)
6663
.setComment("Number of synapse-sections in the cluster.");
6764

65+
registerOutputField("created_at", SAKURA_STRING_TYPE)
66+
.setComment("Timestamp, when resource was created.");
67+
68+
registerOutputField("created_by", SAKURA_STRING_TYPE)
69+
.setComment("ID of the user, who created the resource.");
70+
71+
registerOutputField("updated_at", SAKURA_STRING_TYPE)
72+
.setComment("Timestamp, when resource was updated.");
73+
74+
registerOutputField("updated_by", SAKURA_STRING_TYPE)
75+
.setComment("ID of the user, who updated the resource.");
76+
6877
//----------------------------------------------------------------------------------------------
6978
//
7079
//----------------------------------------------------------------------------------------------

src/hanami/src/api/http/dataset/csv/create_csv_dataset_v1_0.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ CreateCsvDataSetV1M0::CreateCsvDataSetV1M0() : Blossom("Init new csv-file datase
4949
// output
5050
//----------------------------------------------------------------------------------------------
5151

52-
registerOutputField("created_at", SAKURA_STRING_TYPE)
53-
.setComment("Timestamp, when dataset was created.");
54-
5552
registerOutputField("uuid", SAKURA_STRING_TYPE).setComment("UUID of the new dataset.");
5653

5754
registerOutputField("name", SAKURA_STRING_TYPE).setComment("Name of the new dataset.");
@@ -73,6 +70,18 @@ CreateCsvDataSetV1M0::CreateCsvDataSetV1M0() : Blossom("Init new csv-file datase
7370
registerOutputField("uuid_input_file", SAKURA_STRING_TYPE)
7471
.setComment("UUID to identify the file for date upload of input-data.");
7572

73+
registerOutputField("created_at", SAKURA_STRING_TYPE)
74+
.setComment("Timestamp, when resource was created.");
75+
76+
registerOutputField("created_by", SAKURA_STRING_TYPE)
77+
.setComment("ID of the user, who created the resource.");
78+
79+
registerOutputField("updated_at", SAKURA_STRING_TYPE)
80+
.setComment("Timestamp, when resource was updated.");
81+
82+
registerOutputField("updated_by", SAKURA_STRING_TYPE)
83+
.setComment("ID of the user, who updated the resource.");
84+
7685
//----------------------------------------------------------------------------------------------
7786
//
7887
//----------------------------------------------------------------------------------------------

src/hanami/src/api/http/dataset/get_dataset_v1_0.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,16 @@ GetDataSetV1M0::GetDataSetV1M0() : Blossom("Get information of a specific datase
7070
registerOutputField("number_of_columns", SAKURA_INT_TYPE).setComment("Number of columns.");
7171

7272
registerOutputField("created_at", SAKURA_STRING_TYPE)
73-
.setComment("Timestamp, when dataset was created.");
73+
.setComment("Timestamp, when resource was created.");
74+
75+
registerOutputField("created_by", SAKURA_STRING_TYPE)
76+
.setComment("ID of the user, who created the resource.");
77+
78+
registerOutputField("updated_at", SAKURA_STRING_TYPE)
79+
.setComment("Timestamp, when resource was updated.");
80+
81+
registerOutputField("updated_by", SAKURA_STRING_TYPE)
82+
.setComment("ID of the user, who updated the resource.");
7483

7584
//----------------------------------------------------------------------------------------------
7685
//
@@ -123,6 +132,9 @@ GetDataSetV1M0::runTask(BlossomIO& blossomIO,
123132
blossomIO.output["number_of_rows"] = fileHandle.header.numberOfRows;
124133
blossomIO.output["number_of_columns"] = fileHandle.header.numberOfColumns;
125134
blossomIO.output["created_at"] = entry.createdAt;
135+
blossomIO.output["created_by"] = entry.createdBy;
136+
blossomIO.output["updated_at"] = entry.updatedAt;
137+
blossomIO.output["updated_by"] = entry.updatedBy;
126138

127139
return true;
128140
}

0 commit comments

Comments
 (0)