Author Topic: Executing a new version of Migration file: What am I missing  (Read 15502 times)

DQ

  • Jr. Member
  • **
  • Posts: 82
Executing a new version of Migration file: What am I missing
« on: November 25, 2013, 06:48:30 pm »
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

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Executing a new version of Migration file: What am I missing
« Reply #1 on: November 26, 2013, 06:08:45 pm »
You should also update LocalSettings.DefaultDbVersion constant.

DQ

  • Jr. Member
  • **
  • Posts: 82
Re: Executing a new version of Migration file: What am I missing
« Reply #2 on: November 26, 2013, 08:38:05 pm »
I don't see DefaultDbVersion. I did change DbVersion .

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

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Executing a new version of Migration file: What am I missing
« Reply #3 on: November 30, 2013, 05:44:47 am »
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

  • Jr. Member
  • **
  • Posts: 82
Re: Executing a new version of Migration file: What am I missing
« Reply #4 on: November 30, 2013, 10:47:59 am »
Thanks !!  Ya, I missed that.