How to replace created_at and updated_at columns #930
javiles-cl
started this conversation in
General
Replies: 1 comment
-
I don't believe it's currently possible to configure SQLBoiler to utilize a different column for automatic timestamps. From my understanding and testing those only get activated if the database itself has the columns with those names. Aliases are not taken into account when generating code for that. Although you could look to do some sort of DB trigger my suggestion would be to look at Hooks. You should be able to create Before hooks for your models that update/set the time on the fields you are looking at. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I started using SqlBoiler for 2 weeks, so far I am very happy with a library. But there is something that I have not managed to do, my database already has 2 fields for audit handling, created_date and last_modified_date, as I can map the functionality that SQLBOILer has in the created_at and updated_at columns towards the existing fields in my database ? I tried to use the alias functionality but it does not work :(
Beta Was this translation helpful? Give feedback.
All reactions