-
-
Notifications
You must be signed in to change notification settings - Fork 18
Backend logging custom action #1582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -25,5 +25,6 @@ export function buildFoundLogRecordDs(log: TableLogsEntity): FoundLogRecordDs { | |||||
| createdAt: createdAt, | ||||||
| connection_id: connection_id.id, | ||||||
| affected_primary_key: affected_primary_key, | ||||||
| operation_custom_action_name: log.operation_custom_action_name || null, | ||||||
|
||||||
| operation_custom_action_name: log.operation_custom_action_name || null, | |
| operation_custom_action_name: log.operation_custom_action_name ?? null, |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
|
||
| export class AddOperationCustomActionNameToTableLogsEntity1770626855789 implements MigrationInterface { | ||
| name = 'AddOperationCustomActionNameToTableLogsEntity1770626855789'; | ||
|
|
||
| public async up(queryRunner: QueryRunner): Promise<void> { | ||
| await queryRunner.query(`ALTER TABLE "tableLogs" ADD "operation_custom_action_name" character varying`); | ||
| } | ||
|
Comment on lines
+6
to
+8
|
||
|
|
||
| public async down(queryRunner: QueryRunner): Promise<void> { | ||
| await queryRunner.query(`ALTER TABLE "tableLogs" DROP COLUMN "operation_custom_action_name"`); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This log record uses
table_primary_key, butCreateLogRecordDs/TableLogsEntitypersist the primary key underaffected_primary_key. As written, action activation logs will haveaffected_primary_keyunset, and the extratable_primary_keyfield is ignored. Pass the primary key viaaffected_primary_keyhere (and consider removingtable_primary_keyif it's not used anywhere).