-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: hamz2a <[email protected]>
- Loading branch information
Showing
11 changed files
with
181 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
editoast/migrations/2024-11-21-145205_create_stdcm_logs/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE stdcm_logs; |
8 changes: 8 additions & 0 deletions
8
editoast/migrations/2024-11-21-145205_create_stdcm_logs/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CREATE TABLE stdcm_logs ( | ||
id int8 PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, | ||
trace_id VARCHAR(32) UNIQUE NOT NULL, | ||
request jsonb NOT NULL, | ||
response jsonb NOT NULL, | ||
created timestamptz NOT NULL DEFAULT NOW(), | ||
user_id bigint NOT NULL REFERENCES authn_user ON DELETE CASCADE | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use chrono::DateTime; | ||
use chrono::Utc; | ||
use editoast_derive::Model; | ||
use serde::Deserialize; | ||
use serde::Serialize; | ||
use utoipa::ToSchema; | ||
|
||
use crate::core::stdcm::Request; | ||
use crate::core::stdcm::Response; | ||
|
||
editoast_common::schemas! { | ||
StdcmLog, | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize, Model, ToSchema)] | ||
#[model(table = editoast_models::tables::stdcm_logs)] | ||
#[model(gen(ops = c))] | ||
pub struct StdcmLog { | ||
pub id: i64, | ||
pub trace_id: String, | ||
#[model(json)] | ||
pub request: Request, | ||
#[model(json)] | ||
pub response: Response, | ||
created: DateTime<Utc>, | ||
user_id: i64, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters