kibae / typeorm-auditing

TypeORM Auditing: Create history tables and manage changes of entity automatically.
https://www.npmjs.com/package/typeorm-auditing
MIT License
25 stars 3 forks source link

@Column with column different name not working #4

Closed roberto-souza closed 2 years ago

roberto-souza commented 2 years ago

Hello,

I use attributes in classes as CamelCase and in the database I use as SnakeCase, for example:

@Column({ name: 'created_at', type: 'timestamp with time zone' })
createdAt: Date;

When I sent to save an entity threw exception saying Error column "createdAt" of relation "appointments_audit" does not exist.

You can help me?

roberto-souza commented 2 years ago

To complement,

@CreateDateColumn({ name: 'created_at', type: 'timestamp with time zone' })
createdAt: Date;

and

@UpdateDateColumn({ name: 'updated_at', type: 'timestamp with time zone' })
updatedAt: Date;

Too not working to column name.

kibae commented 2 years ago

Hi, @roberto-souza I'll check and fix it soon!

kibae commented 2 years ago

@roberto-souza I fixed this problem and published version 0.5.2. Please check and let me know if there are any problems. Thanks for reporting the problem.

roberto-souza commented 2 years ago

Hello @kibae! Alright, working perfectly! Thank you!