예제 #1
0
        /// <summary>
        /// Drop all UserAuth tables.
        /// </summary>
        private void DropTables()
        {
            var source     = new AssemblyMigrationLoader(typeof(InitialSchema).Assembly);
            var provider   = GetProviderType(this.unitOfWork.Context.DataProvider);
            var connection = this.unitOfWork.Context.ConnectionString;
            var version    = MigrationVersion.FromString("0");

            var migrator = Migrator.CreateMigrator(source, provider, connection, version, false);

            migrator.Execute();

            //Migrator.Migrate(source, provider, connection, null);
        }
예제 #2
0
        /// <summary>
        /// Initialise the database schema, optionally running in preview mode.
        /// </summary>
        /// <param name="preview">The preview mode flag.</param>
        public void InitSchema(bool preview)
        {
            var source     = new AssemblyMigrationLoader(typeof(InitialSchema).Assembly);
            var provider   = GetProviderType(this.unitOfWork.Context.DataProvider);
            var connection = this.unitOfWork.Context.ConnectionString;
            var version    = MigrationVersion.FromString("20140806081722");

            var migrator = Migrator.CreateMigrator(source, provider, connection, version, preview);

            migrator.Execute();

            //Migrator.Migrate(source, provider, connection, null);
        }