English Boards > Support

Executing a new version of Migration file: What am I missing

(1/1)

DQ:
Hello,
  I have created a new Migration_022.cs file to add employee schedule table.  I have followed existing migration class file where added [Migration(22)] attribute and Up() and Down() function.   

I changed DbVersion to 22 and created migrate.txt file which trigger migration(context) function call and execute migration code but somehow my new class is not getting executed.  What am I missing?

 var executor = new TaskExecutor(migrationContext);
                executor.Execute();

emre:
You should also update LocalSettings.DefaultDbVersion constant.

DQ:
I don't see DefaultDbVersion. I did change DbVersion .

 public static int DbVersion { get { return 22; } }

emre:
I've noticed you've defined migration class (22) as a private class. Migrator can access public classes since it loads them dynamically from assembly.

DQ:
Thanks !!  Ya, I missed that.

Navigation

[0] Message Index

Go to full version