Skip to content
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

Support for DB2 z/OS #638 #713

Merged
merged 6 commits into from Aug 1, 2014
Merged

Support for DB2 z/OS #638 #713

merged 6 commits into from Aug 1, 2014

Conversation

@cteig
Copy link
Contributor

@cteig cteig commented Mar 15, 2014

Here is a version of flyway where I have added support for DB2 on z/OS. Any comments will be appreciated.

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Mar 23, 2014

Thanks for contributing this Christine!

A few points:

Are you sure connection.getMetaData().getDatabaseProductName() does not allow you to differentiate the editions? DB2 LUW does return specific strings for each OS. I am sure this can be solved algorithmically instead of through configuration...

Can you extend the driver detection in DriverDataSource as well?

As I do not, and probably never will have access to a z/OS machine, this will require two things:

  • A JUnit Category and Maven Profile for DB2 z/OS with a consistent name. Let's call it DB2zOS and use that everywhere.
  • You should be willing to support this for current and future versions of Flyway. This includes both code and documentation. Is that OK?

Also I will need a pull request for the flyway-3.0 branch of flywaydb.org for the docs.

Thanks!
Axel

@cteig
Copy link
Contributor Author

@cteig cteig commented Apr 21, 2014

Hello,

I agree that it is a better solution if it is possible to decide OS algorithmically instead of through configuration. I will spend more time on this to see if I can change it. I will fix the category, maven profile, and the docs too.

I can't promise that I will have access to z/OS forever, but the customer I work for is starting to use the z/OS version of flyway in great scale. As long as I work for this customer I am happy to support flyway, included the documentation.

Christine

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Apr 24, 2014

Sounds good.

@rejoyce
Copy link

@rejoyce rejoyce commented May 13, 2014

Hi,

would be great if we could get support for DB2 on Z/OS
Have just experienced this issue with the missing SYSCAT.SCHEMATA table.

Richard

…eplatform from getDatabaseProductVersion instead of a property
@cteig
Copy link
Contributor Author

@cteig cteig commented May 16, 2014

Hi

I have updated the pull request now. I found a way to get the databaseplatform (zOS) through getMetaData().getDatabaseProductVersion(). This method will always return DSN for zOS and SQL for Linux, UNIX and Windows (LUW).
The method getMetaData().getDatabaseProductName return only DB2 in both cases.

Since I use the same database-driver for z/OS as for LUW, I can't see that it's necessary to extend DriverDataSource, but tell me if I'm wrong.

I have used DB2zOS for JUnit category og maven profile now, but I not sure if I have misunderstood. Should I do something more than change the name? Couldn't see that I used it other places.

Christine

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented May 18, 2014

Hi Christine,

On the code side, could you:

  • integrate the latest changes from master and ensure the PR can be merged automatically
  • revert any unnecessary formatting changes (a number of files changed even though they have nothing to do with DB2 zOS and nothing was added)

Also please provide a pull request against the flyway-3.1 branch of flywaydb.org containing

  • a database info page for DB2 zOS
  • a section in the DB setup page for DB2 zOS

Cheers
Axel

cteig added 3 commits May 18, 2014
Conflicts:
	flyway-core/src/main/java/org/flywaydb/core/internal/dbsupport/DbSupportFactory.java
@cteig
Copy link
Contributor Author

@cteig cteig commented May 19, 2014

Hi,

I have updated the code and again and I'm working with the documentation. I will do a pull request against flyway-3.1 branch of flywaydb.org as soon as I have finished it.

Christine

axelfontaine added a commit that referenced this issue Aug 1, 2014
@axelfontaine axelfontaine merged commit b8be68f into flyway:master Aug 1, 2014
1 check passed
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Aug 1, 2014

Thanks again Christine! I've finally come around to merge this. Sorry for the delay. What exactly is the use of the separate table space in the metadata table creation script?

Cheers
Axel

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Aug 1, 2014

Hmmm the merge just broke the build :-/

Somehow the zOS testcases aren't properly excluded by default...

@cteig
Copy link
Contributor Author

@cteig cteig commented Aug 3, 2014

Hi,

I saw in #638 that you fixed the test issue before I had time to respond. Thanks!

About the table space in the metadata table script; IBM has recommended one table per table space because many db/2 utilities operate at the level of the table space. For example, backup and restore work at the table space level. And one table per table space makes it possible to backup/restore individual tables.

For the metadata table, Flyway has to be responsible of specifying the table space. For all the user defined tables, the users are responsible of specifying the table space in the sql scripts.

Kind regards
Christine

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Aug 3, 2014

Thanks for clearing this up. Shouldn't it then be named something like ${table}_ts instead of a fixed name to avoid conflicts in case multiple Flyway instances are used?

Cheers
Axel

@cteig
Copy link
Contributor Author

@cteig cteig commented Aug 3, 2014

Yes, I agree. Something like your proposal would be a better naming of the table space.

I have one more fix that I will finish tomorrow, so I will change the name as well.

Christine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants