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

Some properties for RoundhouseSettings in Cake.Common.Tools.Roundhouse are not working properly #1292

Closed
ferminmoli opened this issue Oct 18, 2016 · 8 comments
Milestone

Comments

@ferminmoli
Copy link

ferminmoli commented Oct 18, 2016

Error: C:/Examples/Ecommerce/blanqueria/Ecommerce/build.cake(92,4): error CS0117
: 'Cake.Common.Tools.Roundhouse.RoundhouseSettings' does not contain a definitio
n for 'Drop'

I need to drop the database using this command:

RoundhouseMigrate(new RoundhouseSettings{
ConnectionString = connectionString,
SqlFilesDirectory = "Ecommerce\Scripts",
Drop = false
});

Cake version: 0.15.2
Windows 10 64Bits

@phillipsj
Copy link
Contributor

@ferminmoli Everything is there it just isn't working as you would expect. The Drop Boolean in the settings file is internal. So you run the RoundHouseDrop command and it will toggle the Drop setting as part of the runner. Look here at the RoundhouseDrop alias.: https://github.com/cake-build/cake/blob/develop/src/Cake.Common/Tools/Roundhouse/RoundhouseAliases.cs

var runner = new RoundhouseRunner(context.FileSystem, context.Environment, context.ProcessRunner,   context.Tools);
runner.Run(settings, true);

So you need to run without the drop and it will not execute it:

RoundhouseMigrate(new RoundhouseSettings{
ConnectionString = connectionString,
SqlFilesDirectory = "Ecommerce\Scripts"});

As can be seen here: https://github.com/cake-build/cake/blob/develop/src/Cake.Common/Tools/Roundhouse/RoundhouseRunner.cs

public void Run(RoundhouseSettings settings, bool drop = false)

@ferminmoli
Copy link
Author

Thanks for your help @phillipsj

@patriksvensson
Copy link
Member

Hmm, this feels like something that should be changed.

@ferminmoli
Copy link
Author

@patriksvensson, yes I'm agree with you. I can't figure out how to extend roundhouse functionality to pass more parameters. At the moment I can only run a simple migration and a Drop database but whole roundhouse functionality is encapsulated inside cake classes.

@phillipsj
Copy link
Contributor

@patriksvensson @ferminmoli I agree it isn't intuitive, but having separate commands prevents mistakes as far as drop. I have been wanting to learn more about roundhouse and I don't mind adding the additional that is needed and making that change if you want.

@ferminmoli
Copy link
Author

@phillipsj maybe it can be changed to accept manually parameters to take advantage of whole roundhouse functionality. I'm pretty sure that you have a better idea.

@phillipsj
Copy link
Contributor

@ferminmoli I will use some of the other implementations and post back and example for review.

@gep13 gep13 added this to the v0.17.0 milestone Oct 24, 2016
@gep13 gep13 closed this as completed Oct 24, 2016
@gep13
Copy link
Member

gep13 commented Oct 24, 2016

@phillipsj thanks again for your contribution!

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

No branches or pull requests

5 participants