Giter Club home page Giter Club logo

Comments (19)

andrewtch avatar andrewtch commented on May 24, 2024

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.

andrewtch avatar andrewtch commented on May 24, 2024

any ideas on this issue?

from entityauditbundle.

andrewtch avatar andrewtch commented on May 24, 2024

any news here?

from entityauditbundle.

suncat2000 avatar suncat2000 commented on May 24, 2024

i remove this bundle...

from entityauditbundle.

richardfullmer avatar richardfullmer commented on May 24, 2024

This is happening to me too

from entityauditbundle.

franek avatar franek commented on May 24, 2024

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.

mbadolato avatar mbadolato commented on May 24, 2024

bump

Is this something that might be resolved soon?

from entityauditbundle.

allucardster avatar allucardster commented on May 24, 2024

Hi, I have the same problem with postgreSQL.

someone trick for this?

from entityauditbundle.

lacoolman avatar lacoolman commented on May 24, 2024

This is happening to me too =(

from entityauditbundle.

mbadolato avatar mbadolato commented on May 24, 2024

@beberlei Can you comment on this issue?

from entityauditbundle.

mbadolato avatar mbadolato commented on May 24, 2024

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.

franek avatar franek commented on May 24, 2024

@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.

mbadolato avatar mbadolato commented on May 24, 2024

@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.

allucardster avatar allucardster commented on May 24, 2024

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.

beberlei avatar beberlei commented on May 24, 2024

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.

beberlei avatar beberlei commented on May 24, 2024

There is #29, but it does too much. I only want the relevant changes to lastInsertId()

from entityauditbundle.

mbadolato avatar mbadolato commented on May 24, 2024

@beberlei

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.

mbadolato avatar mbadolato commented on May 24, 2024

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.

DavidBadura avatar DavidBadura commented on May 24, 2024

fixed by #34

from entityauditbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.