コード例 #1
0
        /// <summary>
        /// Stores a new migration history record in the database.
        /// </summary>
        /// <param name="context">The migration context.</param>
        /// <param name="item">The item.</param>
        public virtual void AddItem(MigrationContext context, MigrationHistoryItem item)
        {
            EnsureMigrationHistorySchemaExists(context);

            Database model = new Database(null);
            Table t = model.AlterTable(TableName);

            var row = new Dictionary<string, object>();
            row.Add(DateColumnName, item.Date);
            row.Add(VersionColumnName, item.Version);
            row.Add(DirectionColumnName, (int)item.Direction);
            t.Insert(row);

            foreach (string sql in context.SqlProvider.GenerateSqlCommands(model))
            {
                context.SqlProcessor.ProcessEngineStatement(context, sql);
            }
        }
コード例 #2
0
        /// <summary>
        /// Stores a new migration history record in the database.
        /// </summary>
        /// <param name="context">The migration context.</param>
        /// <param name="item">The item.</param>
        public virtual void AddItem(MigrationContext context, MigrationHistoryItem item)
        {
            EnsureMigrationHistorySchemaExists(context);

            Database model = new Database(null);
            Table    t     = model.AlterTable(TableName);

            var row = new Dictionary <string, object>();

            row.Add(DateColumnName, item.Date);
            row.Add(VersionColumnName, item.Version);
            row.Add(DirectionColumnName, (int)item.Direction);
            t.Insert(row);

            foreach (string sql in context.SqlProvider.GenerateSqlCommands(model))
            {
                context.SqlProcessor.ProcessEngineStatement(context, sql);
            }
        }
コード例 #3
0
 /// <summary>
 /// Stores a new migration history record in the database.
 /// </summary>
 /// <param name="context">The migration context.</param>
 /// <param name="item">The item.</param>
 public override void AddItem(MigrationContext context, MigrationHistoryItem item)
 {
     // ignore ...
 }