smpallen99
Whatwasit - Track the changes to your Ecto models
Just released a new package on hex for tracking changes to your Ecto models.
Its functional, but in the early stages. Could use some additional features like restore, version limits, etc. Let me know what you think.
Most Liked
OvermindDL1
Huh, was actually thinking of making something like this myself. A question though, I notice that it seems to require a User schema of some form to mark whodoneit, however in my system the User is in an LDAP system (not exposed via Ecto since Ecto2 has no LDAP interface, as well as it would not work cross-repo anyway), and the unique ID from the LDAP database is a bigint integer in Ecto. How would I give it the bigint unique ID that does not have a corresponding ecto schema?
smpallen99
It does not need a user model if you don’t want to track who made the change. Please add an issue if want to see support for an LDAP based user model.
To suport your use case, I think we can add an option to the installer for this. Something that would set the user_id to a simple field with a provided type. For the user name, we could add support for a {module, fun} tuple and call the fun if its a tuple.
What do you think?
Steve
OvermindDL1
Just as a comparison, my original idea for a module like this was less generic, I was planning an interface to use PostgreSQL’s natural ability to mark rows as ‘deleted/invalid’ and they no longer appear after in SQL queries (unless you use a specific one to get those specifically deleted ones), thus you can version that way. Could store something like a user on the table itself for example. I am unsure which method is better actually…
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









