Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(migrations): add capacity to up by one #98

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

gfyrag
Copy link
Contributor

@gfyrag gfyrag commented Sep 24, 2024

No description provided.

@gfyrag gfyrag requested a review from a team as a code owner September 24, 2024 13:13
@@ -156,43 +156,15 @@ func (m *Migrator) runInTX(ctx context.Context, db bun.IDB, fn func(ctx context.

func (m *Migrator) Up(ctx context.Context, db bun.IDB) error {
return m.runInTX(ctx, db, func(ctx context.Context, tx bun.Tx) error {
if m.schema != "" && m.createSchema {
_, err := tx.ExecContext(ctx, fmt.Sprintf(`create schema if not exists "%s"`, m.schema))
for {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the iterator things

@gfyrag gfyrag merged commit 25cc374 into main Sep 24, 2024
7 checks passed
@gfyrag gfyrag deleted the feat/migrations-up-by-one branch September 24, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants