// Migrate executes the migration, if it has not already been executed
Migrate executes the migration, if it has not already been executed
// Migrate executes the migration if it has not already been executed
func (m *Runner) Migrate(ctx context.Context) error {
	go func() {
		m.doMigration.Do(func() {
			_, err := m.runMigrations(ctx, m.ds, m.migrations, m.target)
			m.migrationError.Store(err)
			m.ready.Store(true)
			close(m.migrationsDone)
		})
	}()
	select {
	case <-m.migrationsDone:
	case <-ctx.Done():
		return versioning.ErrContextCancelled
	}
	return m.migrationError.Load()
}
func ( m * Runner ) Migrate ( ctx context . Context ) error { go func ( ) { m . doMigration . Do ( func ( ) { _ , err := m . runMigrations ( ctx , m . ds , m . migrations , m . target ) m . migrationError . Store ( err ) m . ready . Store ( true ) close ( m . migrationsDone ) } ) } ( ) select { case <- m . migrationsDone : case <- ctx . Done ( ) : return versioning . ErrContextCancelled } return m . migrationError . Load ( ) }
Migrate executes the migration, if it has not already been executed
Migrate executes the migration if it has not already been executed