Comments (19)
Confirmed, happends on saving; seems like REV is not incremented during sequential save. Any ideas how to fix it?
Running latest Sonata / Audit.
from entityauditbundle.
any ideas on this issue?
from entityauditbundle.
any news here?
from entityauditbundle.
i remove this bundle...
from entityauditbundle.
This is happening to me too
from entityauditbundle.
I have got the same problem with Oracle Database. It is due to this line :
https://github.com/simplethings/EntityAudit/blob/master/EventListener/LogRevisionsListener.php#L156
We need to specify the name of the sequence :
$this->revisionId = $this->conn->lastInsertId('REVISIONS_SEQ');
for a sequence called 'REVISIONS_SEQ'
from entityauditbundle.
bump
Is this something that might be resolved soon?
from entityauditbundle.
Hi, I have the same problem with postgreSQL.
someone trick for this?
from entityauditbundle.
This is happening to me too =(
from entityauditbundle.
@beberlei Can you comment on this issue?
from entityauditbundle.
The solution provided by @franek seems to work (albeit needs 'REVISIONS_ID_SEQ' as the sequence name), so it seems to be just a matter of getting a solution in place that allows for the sequence name when it's needed (Oracle, PostgreSQL etc), and without the sequence name when not (MySQL etc).
I don't have enough knowledge of the underlying Doctrine components to implement that and submit a patch
from entityauditbundle.
@mbadolato I have proposed this PR #17 to handle sequence name and the possibility to change the name of each elements (column name, ...) but the PR has been refused.
from entityauditbundle.
@franek Personally, I like the idea of having some of those options!
That PR, doesn't (from what I can tell, however... I didn't look at the actual commit), solve the issue of the $this->conn->lastInsertId()
statement needing to have a sequence name listed when used with databases that need it vs. no sequence specified, as it currently is, when the database does not need it.
from entityauditbundle.
I think the PR of @franek is valid for the bundle because the table of revisions cause many problems with the process of "Audit" for DBMS like Oracle or PostgreSQL.
For example in Oracle, the column "timestamp" can't be used because is a reserved word. For this reason I had to disable the bundle for projects with Oracle and implement by hand another process of Audit for that DBMS.
from entityauditbundle.
Can someone create a PR for this? I happely accept. I don't use PostgreSQL and this bundle together and would need to create a test setup.
from entityauditbundle.
There is #29, but it does too much. I only want the relevant changes to lastInsertId()
from entityauditbundle.
The one line change listed by @franek up above, but with the default sequnce name of 'REVISIONS_ID_SEQ' instead, is all that is needed to make postgresql work. I'm currently using a forked version of your repository with that change in place and it's working fine.
src/SimpleThings/EntityAudit/EventListener/LogRevisionsListener.php
Line 157 (in function getRevisionId()
) Changed from
$this->revisionId = $this->conn->lastInsertId();
to
$this->revisionId = $this->conn->lastInsertId('REVISIONS_ID_SEQ');
I haven't submitted back a patch because I don't know how MySQL would respond to that statement with a sequence name listed instead of empty as in the original call.
If MySQL will ignore the sequence name, I can submit my forked change to you in a PR
from entityauditbundle.
Ok, I have MySQL running on a dev box here where I currently have my Symfony project running. As a test, I changed my parameters.yml file to point to MySQL instead of postgres, created my db, and did a data fixtures load. All was fine. I did an update to one of my audited entities and all was fine again. The data is showing in the database with 'UPD'. So it seems that MySQL ignores the sequence name.
I'm submitting my patch over to you. It will come from @CainAndAssociates, not my personal repository.
cc: @beberlei
--mark
from entityauditbundle.
fixed by #34
from entityauditbundle.
Related Issues (20)
- Set up entity_manager
- What happened to this project? It is transfer to `sonata-project`. HOT 4
- Audit tables are being generated for all entities, not just the ones specified in config HOT 3
- Support Annotations HOT 4
- Compare Revision (`CompareAction`) route not working HOT 11
- Identical Dates should not create a revision HOT 2
- Integration with EasyAdminBundle ? HOT 5
- Argument 3 passed to SimpleThings\EntityAudit\Revision::__construct() must be of the type string, null given HOT 3
- The "security.token_storage" service or alias has been removed or inlined when the container was compiled. HOT 1
- Extending revision entity/table. HOT 1
- Auditing an entity which uses foreign key as primary key fails HOT 2
- Ignore fields option not working HOT 8
- Support for translatable entities HOT 1
- Many To Many audit relation fail with new entity in the relation. HOT 9
- View changes not showing HOT 1
- Support for `doctrine/collections` ^2.0 HOT 1
- Incompatible with Lazy-Loading Proxies (Ghost)? HOT 10
- Doctrine ORM 3 support HOT 2
- Ignore related tables for auditiong HOT 2
- Multiple many-to-many relationships to same table causes DUPLICATE KEY error.
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 entityauditbundle.