Exemplo n.º 1
0
        public SqliteFixture() : base(new SqliteConnection($"Data Source={Guid.NewGuid()}.db"), new SqliteDialect())
        {
            var runner = new SqliteMigrationRunner(Connection.ConnectionString);

            runner.CreateDatabaseIfNotExists();
            runner.MigrateUp(typeof(TMigrationInfo).Assembly, typeof(TMigrationInfo).Namespace);
        }
Exemplo n.º 2
0
Arquivo: Add.cs Projeto: qiqi545/HQ
        private static void MigrateToLatest(string connectionString, IdentityOptionsExtended identityOptions)
        {
            var runner = new SqliteMigrationRunner(connectionString);

            if (identityOptions.Stores.CreateIfNotExists)
            {
                runner.CreateDatabaseIfNotExists();
            }

            if (identityOptions.Stores.MigrateOnStartup)
            {
                runner.MigrateUp(typeof(CreateIdentitySchema).Assembly, typeof(CreateIdentitySchema).Namespace);
            }
        }