Migrations and SQL

Topics: Core, General
Apr 30, 2015 at 6:38 PM
Hello...

Is it possible to write and execute DDL directly in the DB without using the migration-functionality?

Does the migration-functionality do anything else than create/ update table, or is it also maintaining some settings/ registrations inside Orchard?

Cheers
Janus
Developer
May 4, 2015 at 1:10 PM
I think you can, since you can execute SQL expression directly using the NH session. You'd have to inject an ISessionLocator into your migrations class to access the session.

Migrations in Orchard are typically only used to define / alter content types and database tables. Settings themselves (assuming you are referring to site settings) are stored as content in the database and is typically not done through migrations.