Comments (4)
Hi! I'm sorry you're having an issue with loading old versions.
Can you provide more details about your issue:
- which function are you calling and how?
- (if applicable) how did you configure ex_audit?
- add the entire error message
from ex_audit.
I'm just calling MyApp.Version |> MyApp.Repo.all
and the error I get is
cannot load `"some_table_name"` as type ExAudit.Type.Schema for field :entity_schema in %MyApp.Version{...}
(obviously with some real table name)
The error is easy to reproduce:
- have something tracked
- clear the
tracked_schemas
config - run the query
Aside, the version_schema
and tracked_schemas
should not be configuration for the ex_audit application but somehow bound to the Repo at hand (see https://hexdocs.pm/elixir/1.9.1/library-guidelines.html#avoid-application-configuration)
from ex_audit.
I feel like this might be out of spec for this library. If you remove a schema from the config, you should also write a migration that deletes all of these entries (the execute
function can be used in ecto migrations to run arbitrary SQL queries):
DELETE FROM versions WHERE entity_schema= 'some_table_name'
Of course, you could also decide to keep these in a seperate table before deleting them from the versions table:
CREATE TABLE some_table_name_versions AS (SELECT * FROM versions WHERE entity_schema = 'some_table_name');
from ex_audit.
I just ran into this issue again after renaming a table. I had to go down to SQL to fix this, because the ExAudit.Type.Schema
won't let me just add an arbitrary atom into the :tracked_schemas
env.
from ex_audit.
Related Issues (20)
- A way to use the original Repo HOT 5
- Handling Decimal changes HOT 5
- Support for multi schema versioning HOT 2
- Store patch as map(json) HOT 1
- Who reviews the pull requests? HOT 3
- Increased logging after switching to using ExAudit.Repo HOT 3
- Getting error when using ExAudit.Repo HOT 2
- Getting some errors on existing code HOT 1
- Tracking deletion of nested association in parent model update HOT 1
- Version 0.7 on hex.pm does not contain the same code as described in github HOT 2
- Callback Repo.reload missing HOT 2
- Wrong option key in documentation for ExAudit.Repo.history HOT 1
- Recording custom data with Plug does not work in Phoenix LiveView App HOT 1
- default_options/1 can't be overridden HOT 3
- Prefix support
- Conflicting behaviors using ExAudit.Repo HOT 3
- About maintaining this library. HOT 1
- New error prevent tracked schemas to write into DB HOT 1
- Using ex_audit breaks `returning` option for Repo functions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ex_audit.