forked from SparkDevNetwork/Rock
-
Notifications
You must be signed in to change notification settings - Fork 12
Creating Rock Migrations
nairdo edited this page Feb 21, 2013
·
10 revisions
When your code is ready to check in and you're ready to include it in the database as well, here's a checklist to review and use.
- Run the
Dev Tools\Sql\CodeGen_PagesBlocksAttributesMigration.sqlscript. It will output stuff you'll want to use in your next step. - Run
AddMigration [YOUR_MIGRATION_NAME] - Edit this skeleton migration and paste in the stuff from the MigrationUp output into your migration's
Up()method and then the MigrationDown output into theDown()method. - REVIEW each item you just pasted. Not all of them are things you should include in your migration.
- Manually add any other data items that were not already accounted for by the SQL script including:
- EntityTypes
- NoteTypes
- PageContext (if any of your blocks use Context you should double-check this one)
- Replace your db name with a new database name into your RockContext connection string in your
web.connectionStrings.configfile. - Run Update-Database to see if it worked
- Verify everything by running Rock (F5) and checking every detail of your stuff.
- If it's not good return to step 3 in the previous section; otherwise proceed to Commit/Push/Deploy
If everything looks good, you can commit your changes, merge (as needed) and push up to origin.