Skip to content

Commit

Permalink
✨ (Audit) Adiciona coluna com o nome da entidade do usuário
Browse files Browse the repository at this point in the history
  • Loading branch information
victorLessa committed Apr 25, 2024
1 parent 12ad8d1 commit ddaaeb0
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 58 deletions.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,9 @@ export default class Audits extends BaseSchema {
table.increments('id')
// User id from ctx auth obj
table
.integer('user_id')
.unsigned()
.nullable()
.defaultTo(null)
.references('id')
.inTable('users')
.onDelete('SET NULL')
table.integer('user_id').unsigned().nullable()
// User Model Name
table.string('user_entity_name').defaultTo('users')
// Entity Id
table.string('auditable_id').nullable()
// Entity Name
Expand Down
61 changes: 21 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adonis5-audit",
"version": "3.1.1",
"version": "4.0.0",
"description": "Audit provider for AdonisJS 5",
"scripts": {
"mrm": "mrm --preset=@adonisjs/mrm-preset",
Expand Down Expand Up @@ -97,10 +97,12 @@
},
"dependencies": {
"@types/lodash": "^4.14.191",
"change-case": "^4.1.2",
"debug": "^4.3.4",
"lodash": "^4.17.21",
"luxon": "^3.2.1",
"node-exceptions": "^4.0.1"
"node-exceptions": "^4.0.1",
"pluralize": "^8.0.0"
},
"peerDependencies": {
"@adonisjs/events": "^7.1.2"
Expand All @@ -124,6 +126,7 @@
"@release-it/bumper": "^4.0.0",
"@types/debug": "^4.1.7",
"@types/node": "^14.18.36",
"@types/pluralize": "^0.0.33",
"@types/ramda": "^0.27.62",
"adonis-provider-tester": "^1.2.0",
"chai": "^4.3.4",
Expand Down
Loading

0 comments on commit ddaaeb0

Please sign in to comment.