This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Is it possible to run custom SQL-statements as part of the migrations? If yes, how? I need a nifty way to add full text search capabilities to my database, and I thought a good way was to check the fields in each class, and see if the index-property was set, and if yes, add an SQL-statement to make it happen. This is a temporary fix until you get your FTS-support for SQL-engines up and running :)
|
|
|
The only way to do this at the moment is to drop down to ADO.NET, which in turn involves creating a parallel database connection (because we don't provide access to our connection). This certainly would be a good feature to add though -- I'll see if it's something we can easily implement and let you know! |
|
|
That would be great! Thanks for the quick response! |
|
|
Okay, this will be included in nighly builds dated 4 Feb 2010 and above, available from about 1500 GMT. The new API is Migration.ExecuteNativeCommand. This is declared as taking object, but for SQL databases it must be a string containing the required SQL, e.g. public override Up() { (We don't support IDbCommands and parameters because they're generally not useful in DDL scenarios. The reason for declaring this as object is to support non-SQL databases which may require richer commands such as a combination of a command string and a HTTP method.) Please let us know if you run into any problems. (One limitation we have at the moment is that we don't provide a way to detect which database engine you're running against in case you need to execute different SQL for different engines, but I believe you are SQL Server only so this shouldn't be an issue for you.) |
|
|
This is great, I'll test it tomorrow evening after the nightly is available. I'll give you feedback for sure :)
|
|