-
Notifications
You must be signed in to change notification settings - Fork 245
Roundhouserefreshdatabasefnh
ferventcoder edited this page Jun 19, 2011
·
30 revisions
- Create a console application
- Make it x86.
- Use NuGet to install
roundhouse.refreshdatabase.fnh
. - Set the start up program to
RefreshDatabase.Main()
. - Add a project reference to your application's DLL that has the Fluent Mappings (and/or HBMs)
- OPTIONAL: Add a project reference to your application's DLL that has the conventions (could be the same as the step above).
- Set up the following code:
private static bool _isThisInitialDevelopment = true;
private static string _nameOfInitialScript = "0001_CreateTables_NH.sql";
private static string _nameOfUpdateScript = "0002_AlterTables_NH.sql";
//roundhouse information
private static string _databaseName = "__REPLACE__";
private static string _pathToSqlScripts = @"..\..\..\__REPLACE__";
private static string _repositoryPath = "__REPLACE__";
//restore
private static bool _restoreDuringMaintenance = true;
private static string _pathToRestore = @"\\__REPLACE__.bak";
//Note: Add a reference to the project that has the Mappings/Conventions
private static string _mappingsAssemblyPath = @".\__REPLACE__.dll";
private static string _conventionsAssemblyPath = @".\__REPLACE__.dll";
- Then right click on the project and select Debug -> Start.