SambaPOS Forum

English Boards => Support => Topic started by: DQ on November 25, 2013, 06:48:30 pm

Title: Executing a new version of Migration file: What am I missing
Post by: DQ 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();
Title: Re: Executing a new version of Migration file: What am I missing
Post by: emre on November 26, 2013, 06:08:45 pm
You should also update LocalSettings.DefaultDbVersion constant.
Title: Re: Executing a new version of Migration file: What am I missing
Post by: DQ on November 26, 2013, 08:38:05 pm
I don't see DefaultDbVersion. I did change DbVersion .

 public static int DbVersion { get { return 22; } }
Title: Re: Executing a new version of Migration file: What am I missing
Post by: emre 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.
Title: Re: Executing a new version of Migration file: What am I missing
Post by: DQ on November 30, 2013, 10:47:59 am
Thanks !!  Ya, I missed that.