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

Check for required property migrationsTable of RunnerOption #1227

Open
weslord opened this issue Jul 9, 2024 · 0 comments
Open

Check for required property migrationsTable of RunnerOption #1227

weslord opened this issue Jul 9, 2024 · 0 comments
Labels
s: pending triage Pending Triage

Comments

@weslord
Copy link

weslord commented Jul 9, 2024

Description

Discovered that migrationsTable was actually a required property when converting some JavaScript files to TypeScript.

I had been calling runner() without providing migrationsTable and it seemed to work fine:

await runner({
    dbClient: dbClient,
    dir: 'db/migrations',
    direction: 'up',
  })

Behind the scenes I expected it was using the default value of "pgmigrations", same as the CLI.

It was actually coercing the missing value to a string and creating a migrations table named "undefined". Probably not harmful (it certainly wasn't in my case), but a little surprising. Feels more like an unexpected side-effect than a deliberate choice.

Suggested solution

Either

Alternative

No response

Additional context

No response

@weslord weslord added the s: pending triage Pending Triage label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: pending triage Pending Triage
Projects
None yet
Development

No branches or pull requests

1 participant