Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Support for MySQL databases was added into RoundhousE #3
I've added initial support for MySQL databases into RoundhousE migrator. It is expected that everything should work in cases when connection string parameter was provided to rh.exe
Here is full list of my changes:
TODO: Initialize configuration/system.data/DbProviderFactories app.config section in code.
FIXME: Quick workaround for MySQL's defect with reserved words auto-quoting. This change potentially could introduce regressions for Access, MS SQL Server or Oracle. IMO better solution is to migrate into NH 3.1 which has bugfix for this problem. http://22.214.171.124/browse/NH-1906
TODO Do we need anything for MySQL? For ex MS SQL Server implemenation has schema creation script and Oracle creates db-sequences.
It would be great if you have a time to look into this changes.
There is one more commit with defect correction. This change fixes issue for all database providers, so I think it is important.
Correct defect. In DefaultDatabase class, get_current_script_hash and has_run_script_already methods must fetch hash for the latest script version instead of the first version.
Glad that you are opened to accept this pull request.
During development of this feature I was a little bit warred if there will be a problems with pushing my changes into upstream project.
Yes, I did. I sent pull request only to chucknorris account and did not included you. Sorry about that.
Do you planning update to the stable NHibernate 3.1 or you are thinking about 3.2?
In any cases I'm ready to merge any changes into my Roundhouse.MySQL fork, so it would be easier to you to pull all my changes.
Should I wait for changes from your ferventcoder/roundhouse fork or in chucknorris/roundhouse?
Could you let me know when it will be better for me to pull those changes into my fork?
JFYI, I'm going into vacation and probably will not respond until May 28. After that I will merge any of new changes and resend pull request to you.
Thank you for your work on this project (... and waiting to see the new strongly-typed detached QueryOver instead of Criteria ;)
Thank you for including tests. Taking a look at it though, you migrated over to NUnit, which I have plans to do at some point, but not yet.
Also, references are in lib/references (unless they are nuget packages, then they are in the packages folder). You may noticed I already have a folder for MySQL there.
Also some of the naming here is inconsistent.
The naming convention is like this:
Andy put together a ReSharper file that I am going to add that enforces all of this so you won't have to have those R# ignore comments on the top of files.
Regarding MySQL specifically:
I haven't used MySQL in such a long time, but if I remember right, there was a separation of instance and database. The create/restore should be to a database, not an instance. There should be a command to destroy a database in an instance.
To be hones, I've added only single integration test which were used more like entry point for debugging.
NUnit was chosen because I tried to configure MbUnit TestRunner for ReSharper but with no luck. I did not spent a lot of time for this and just ended up with single NUnit test class. This test class is not fit at all into MbUnit/BDD test approach, so it could be easily ignored.
Also, I didn't work with BDD approach at all. I would be glad to cover MySQL-related code with tests but I don't know how to write correct BDD-tests.
As for naming convention. I tried to follow existed naming convention but I think there could be mistakes because I usually write code by following Microsoft Coding Guidelines and write unit tests with naming convention which similar to BDD.
ReSharper naming rules for this particular naming convention will definitely help for coding.
Yes, I know that. I will try to add this functionality after merge.
Hmm. I know CREATE DATABASE and CREATE SCHEMA statements but they are sysonyms in MySQL.
I had take a look at your latest changes and will try to merge them next week.
Thank you for your feedback.
This is really good news. Thanks!
Don't worry about exposed password. It was my stupid mistake and the most clever solution here will be just to update my password.
So my next changes will be:
Default user for MySQL database is usually 'root' with no password.
We could use 'root' without password of username 'root' plus password 'root'. What do you think?
Did you have a look into ILMerge issue? Looks like UppercuT build script doesn't pass MySql.Data.dll into ILMerge.
The reason I am not a fan of root/"" is that the suggestion that was there was to secure that account. I wouldn't want a convention where RH is telling others not to secure the account down. I am thinking we could have it come back and ask the user/pass combo when running for mysql if it detects you don't have those filled out in the connection string.
The mysql nuget package I was talking about is really a chocolatey nuget package - http://nuget.org/List/Packages/mysql
I don't see the connector available here - http://nuget.org/List/Search?searchTerm=tag%3A%20MySQL