Skip to content

Can an Orchard Migration Add a Database View? #14968

Answered by fuzl-llc
fuzl-llc asked this question in Q&A
Discussion options

You must be logged in to vote

So, I have a solution I'm posting in case it might be helpful for someone else... not sure if this is the right way or if it might be weird... First I tried working with the connection on the SchemaBuilder I'm using in other places in my migration class, assuming I could plug into whatever transaction was going on there:

var command = SchemaBuilder.Connection.CreateCommand();
command.CommandText = "CREATE VIEW nodes AS  select * from siteNodePartIndex;";
command.ExecuteNonQuery();

Unfortunately that gives and error I couldn't solve: The transaction associated with this command is not the connection's active transaction; see https://fl.vu/mysql-trans So, then I noticed there is an IDbConne…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@hishamco
Comment options

@Piedone
Comment options

@fuzl-llc
Comment options

Answer selected by fuzl-llc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants