示例#1
0
        private void CreateMigrationsTableIfNotExists()
        {
            var existsResult = UnitOfWork.Current.Session.ExecuteQuery(
                dbAdapter.CreateGetTableMetadataCommand(MIGRATIONS_TABLE_NAME));

            if (existsResult.Count() != 0)
            {
                return;
            }
            var createMigrationsTable = new DbCommandSpec()
                                        .SetCommandText(string.Format("create table {0} (Name varchar(200))", MIGRATIONS_TABLE_NAME));

            UnitOfWork.Current.Session.ExecuteNonQuery(createMigrationsTable);
            Log.Debug("Migrations table created");
        }