Example #1
0
 private void TryCreateVersionTable()
 {
     _dataClient.Add
     .Table(VERSION_TABLE_NAME)
     .WithColumns(
         Column.String("migrationgroup").Size(200).NotNull(),
         Column.Int64("version").NotNull(),
         Column.String("info").Size(1000),
         Column.Date("applied")
         );
     _dataClient.AddPrimaryKey(VERSION_TABLE_NAME, "migrationgroup", "version");
     _dataClient.Commit();
 }
Example #2
0
 private void InsertOldVersionTableVersionNumber(int number, string group = "default")
 {
     _client.Insert.Into(VersionRepository.OLD_VERSION_TABLE_NAME)
     .Columns("name", "version")
     .Values(group, number);
     _client.Commit();
 }
Example #3
0
        public void Run(string seedName, string param = null, string migrationGroup = null)
        {
            Type seedType = MigrationFinder.FindSeed(_targetAssembly, seedName);

            Log.Info("Starting seed migration");
            Log.Info("Migration group: " + VersionRepository.GetMigrationGroup(migrationGroup));
            Log.Info(String.Format("Applying Seed -> [{0}]", seedName));

            var migration = (SeedMigration)Activator.CreateInstance(seedType);

            migration.SetDataClient(_dataClient);
            migration.Up(param);
            _dataClient.Commit();
        }
Example #4
0
        public void Run(string seedName, string param = null)
        {
            var seedType = MigrationFinder.FindSeed(_targetAssembly, seedName);

            Log("Starting seed migration");
            var msg = String.Format("Applying Seed -> [{0}]", seedName);

            if (param != null)
            {
                msg += " Param: " + param;
            }
            Log(msg);

            var migration = (SeedMigration)Activator.CreateInstance(seedType);

            migration.SetDataClient(_dataClient);
            migration.Up(param);
            _dataClient.Commit();
            Log("Seed Migration: success");
        }