Default Schema

466 views
Skip to first unread message

Anthony

unread,
Feb 18, 2012, 10:26:14 AM2/18/12
to FluentMigrator Google Group
Hi all,

I was wondering how, if possible, I could set a default schema (other
than dbo) for the migrations to run under?

The user I log into the database as has its default schema set, but
the migrations don't seem to honour that.

Any ideas?

Thanks

jtreuting

unread,
Feb 18, 2012, 12:57:00 PM2/18/12
to fluentmigrato...@googlegroups.com
You can use the WithSchema option, but I don't think there is a way to set it once and have it default to that.  I think you have to put it in each command, but I might be wrong.

Sent from my  phone, please ignore typos and brevity


-----Original message-----
--
You received this message because you are subscribed to the Google Groups "FluentMigrator Google Group" group.
To post to this group, send email to fluentmigrato...@googlegroups.com.
To unsubscribe from this group, send email to fluentmigrator-goog...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fluentmigrator-google-group?hl=en.

Anthony

unread,
Feb 18, 2012, 1:05:13 PM2/18/12
to FluentMigrator Google Group
mmm yeah,

I've just read through the source and saw no way to do it
automatically.

For the moment I have just created a bunch of extension methods that
automatically pop-in the schema I'm using (using the standard InSchema
method).

Glenn Condron

unread,
Feb 18, 2012, 8:47:35 PM2/18/12
to fluentmigrato...@googlegroups.com
It's probably not a bad idea to make it something that could be configured once and used by default though.

What sort of method would work best though? Set the schema once per migration or once for all migrations or both?

Andrew Busby

unread,
Feb 18, 2012, 9:23:53 PM2/18/12
to fluentmigrato...@googlegroups.com

Really this sort of thing should be placed in the conventions functionality then use it where appropriate.

 

I am surprised that this was not already included in the convention stuff but I think it is because conventions were added before the schema support.

 

The schema should be set for all migrations and can be overridden on a migration basis using the WithSchema option.

Anthony

unread,
Feb 18, 2012, 11:15:51 PM2/18/12
to FluentMigrator Google Group
I do like the idea of setting this up as a convention, should I set up
a issue on the github site?


On Feb 19, 12:23 pm, "Andrew Busby" <a...@willand-it.com> wrote:
> Really this sort of thing should be placed in the conventions functionality
> then use it where appropriate.
>
> I am surprised that this was not already included in the convention stuff
> but I think it is because conventions were added before the schema support.
>
> The schema should be set for all migrations and can be overridden on a
> migration basis using the WithSchema option.
>
> From: fluentmigrato...@googlegroups.com
> [mailto:fluentmigrato...@googlegroups.com] On Behalf Of Glenn
> Condron
> Sent: 19 February 2012 01:48
> To: fluentmigrato...@googlegroups.com
> Subject: Re: Default Schema
>
> It's probably not a bad idea to make it something that could be configured
> once and used by default though.
>
> What sort of method would work best though? Set the schema once per
> migration or once for all migrations or both?
>
> On Sun, Feb 19, 2012 at 5:05 AM, Anthony <anthony.truskin...@gmail.com>
> <mailto:fluentmigrator-google-group%2Bunsu...@googlegroups.com> .
>
> > For more options, visit this group
>
> athttp://groups.google.com/group/fluentmigrator-google-group?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "FluentMigrator Google Group" group.
> To post to this group, send email to
> fluentmigrato...@googlegroups.com.
> To unsubscribe from this group, send email to
> fluentmigrator-goog...@googlegroups.com
> <mailto:fluentmigrator-google-group%2Bunsu...@googlegroups.com> .

Daniel Lee

unread,
May 1, 2013, 5:43:02 PM5/1/13
to fluentmigrato...@googlegroups.com, alibha...@gmail.com
Hi Ashiq,

There is an issue for this: https://github.com/schambers/fluentmigrator/issues/290 and it has been on my todo list for a while. It is only a small change, just have to find some time for it!

//Daniel
Reply all
Reply to author
Forward
0 new messages