Inheritance: System.Data.Entity.Migrations.DbMigrator
Esempio n. 1
0
        public override void Uninstall()
        {
            //run the migrator. this will remove all the tables created by this migration
            var migrator = new OAuthDbMigrator(new Configuration());
            migrator.Update("0");

            base.Uninstall();
        }
Esempio n. 2
0
        public override void Install()
        {
            //set db context to null to avoid any errors
            DatabaseManager.SetDbInitializer<OAuthDbContext>(null);

            //run the migrator. this will update any pending tasks or updates to database
            var migrator = new OAuthDbMigrator(new Configuration());
            migrator.Update();

            base.Install();
        }
Esempio n. 3
0
        public void Run()
        {
            if (!DatabaseManager.IsDatabaseInstalled())
                return;

            //set db context to null to avoid any errors
            DatabaseManager.SetDbInitializer<OAuthDbContext>(null);

            //run the migrator. this will update any pending tasks or updates to database
            var migrator = new OAuthDbMigrator(new Configuration());
            migrator.Update();
        }
Esempio n. 4
0
        public void Run()
        {
            if (!DatabaseManager.IsDatabaseInstalled())
            {
                return;
            }

            //set db context to null to avoid any errors
            DatabaseManager.SetDbInitializer <OAuthDbContext>(null);

            //run the migrator. this will update any pending tasks or updates to database
            var migrator = new OAuthDbMigrator(new Configuration());

            migrator.Update();
        }
        public void Run()
        {
            if (!DatabaseManager.IsDatabaseInstalled())
            {
                return;
            }

            //check if the plugin is installed or not?
            var pluginFinder = mobSocialEngine.ActiveEngine.Resolve <IPluginFinderService>();

            if (pluginFinder.FindPlugin("mobSocial.Plugins.oAuth") == null)
            {
                return; //plugin is not installed
            }
            //set db context to null to avoid any errors
            DatabaseManager.SetDbInitializer <OAuthDbContext>(null);

            //run the migrator. this will update any pending tasks or updates to database
            var migrator = new OAuthDbMigrator(new Configuration());

            migrator.Update();
        }