Esempio n. 1
0
 private void AddSchemaChange(Models.SchemaChange changeScript)
 {
     if (changeScript.Status == Models.SchemaChange.Status_Success)
     {
         _database.Save(changeScript);
     }
 }
Esempio n. 2
0
        private Models.SchemaChange BuildSchemaFromFile(UpdateScript updateScript)
        {
            List <string> scriptLines = ExtractSqlFromFile(updateScript);

            Models.SchemaChange script = new Models.SchemaChange();
            script.DatabaseVersion = updateScript.Name.ToLower() == INITIAL_DATABASE_SCHEMA_FILENAME ? .5 : updateScript.Version;
            script.LogThisChange   = updateScript.Name.ToLower() == INITIAL_DATABASE_DEFAULTS_FILENAME ? false : true;
            script.DateApplied     = DateTime.Now;
            script.ScriptName      = updateScript.Name;
            script.Status          = Models.SchemaChange.Status_NotRan;
            script.Notes           = ExtractComments(scriptLines, NOTE_COMMENT_PREFIX);
            script.ScriptContent   = BuildScriptContent(scriptLines);
            script.ScriptLines     = scriptLines;
            return(script);
        }