New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define schema for javers related tables #398

Closed
ianagius opened this Issue Jul 5, 2016 · 14 comments

Comments

Projects
None yet
5 participants
@ianagius
Contributor

ianagius commented Jul 5, 2016

At the moment, JaVers is creating tables in the public schema. It would be great to be able to define the schema where these tables are created,

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Jul 5, 2016

Agreed but schema support have to be implemented in polyJdbc first

@ouaibsky

This comment has been minimized.

ouaibsky commented Sep 6, 2016

It could be nice to provide some configuration as well in order to tune table name.
I'm working for a big company, where DBA's rules are strict and we must follow some guidelines on naming (mainly table)

Christophe

@ianagius

This comment has been minimized.

Contributor

ianagius commented Sep 6, 2016

has there been any progress on this case? We just need to expose a setter method for private String schema property in SchemaInspectorImpl.

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Sep 6, 2016

no progress yet. Dont think that someone from core team will take this issue soon. If you need this feature - contribute

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Sep 6, 2016

ianagius added a commit to ianagius/javers that referenced this issue Sep 16, 2016

javers#398 added withSchema() to SqlRepositoryBuilder to enable users…
… to create and use tables in a defined Schema.

As part of the change, the static table and sequence names in the FixedSchemaFactory class have been made private and access to them is made available through static getters (which check if a schema was defined).

The JaversSchemaManager has been modified to check for the javers tables if a schema has been defined.  If no schema has been defined, this resposibility to handed over to PolyJDBC.
@ianagius

This comment has been minimized.

Contributor

ianagius commented Sep 16, 2016

We have decided to contribute :) and we have created a pull request for you to consider. Let us know if you have any questions or you would like further clarifications.

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Sep 16, 2016

I can't accept this, see #433 (review)
It will be easier to work on this issue, if you follow my guidelines. As I wrote in the second comment in this issue: schema support has to be implemented in polyJdbc first.

@LucasDesenv

This comment has been minimized.

LucasDesenv commented Sep 20, 2016

This is a good one... It's not quite nice to use public schema for auditing.. kinda security failure, no? Or I didn't get it?

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Sep 20, 2016

security failure? I'm affraid that you are missing that JaVers doesn't write to public schema. It writes to a default schema, for most databases it means schema of a current db user

@LucasDesenv

This comment has been minimized.

LucasDesenv commented Sep 20, 2016

Oh, now I get it! Thanks for explaining.

ianagius added a commit to ianagius/javers that referenced this issue Sep 22, 2016

Merge branch '398' of https://github.com/ianagius/javers into 398-old
* '398' of https://github.com/ianagius/javers:
  javers#398 added withSchema() to SqlRepositoryBuilder to enable users to create and use tables in a defined Schema.
@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Oct 12, 2016

done & released in 2.4.0

@pedroxs

This comment has been minimized.

pedroxs commented Oct 27, 2017

How to configure the schema? I could not find anywhere on the docs page

@bartoszwalacik

This comment has been minimized.

@pedroxs

This comment has been minimized.

pedroxs commented Nov 8, 2017

Perfect, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment