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

astro db push suggests adding 'deprecated: true' flag to the wrong column/table in error message #10510

Closed
1 task
jacobdalamb opened this issue Mar 20, 2024 · 1 comment · Fixed by #10600
Closed
1 task
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@jacobdalamb
Copy link
Contributor

Astro Info

Astro                    v4.5.8
Node                     v18.18.2
System                   macOS (arm64)
Package Manager          bun
Output                   server
Adapter                  @astrojs/vercel/serverless
Integrations             astro:db
                         @astrojs/db/file-url

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

astro db push error message incorrectly suggests adding 'deprecated: true' flag to Cards.timestamp instead of Cards.date when detecting potential column rename. The same goes for table renaming.

astro db push

✔ Connected to remote database.
▶ Potential column rename detected: Cards.timestamp, Cards.date
  You cannot add and remove columns in the same table.
  To resolve, add a 'deprecated: true' flag to 'Cards.timestamp' instead.
  Stack trace:
    at getMigrationQueries (file:///Users/jacoblamb/GitHub/minecraft-memory-test/node_modules/@astrojs/db/dist/core/cli/migration-queries.js:62:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async db (file:///Users/jacoblamb/GitHub/minecraft-memory-test/node_modules/astro/dist/cli/db/index.js:20:3)
    at async cli (file:///Users/jacoblamb/GitHub/minecraft-memory-test/node_modules/astro/dist/cli/index.js:169:5)

What's the expected result?

✔ Connected to remote database.
▶ Potential column rename detected: Cards.timestamp, Cards.date
  You cannot add and remove columns in the same table.
  To resolve, add a 'deprecated: true' flag to 'Cards.date' instead.
  Stack trace:
    at getMigrationQueries (file:///Users/jacoblamb/GitHub/minecraft-memory-test/node_modules/@astrojs/db/dist/core/cli/migration-queries.js:62:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async db (file:///Users/jacoblamb/GitHub/minecraft-memory-test/node_modules/astro/dist/cli/db/index.js:20:3)
    at async cli (file:///Users/jacoblamb/GitHub/minecraft-memory-test/node_modules/astro/dist/cli/index.js:169:5)

Link to Minimal Reproducible Example

https://astro.new/basics?on=stackblitz

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Mar 20, 2024
@matthewp matthewp added - P4: important Violate documented behavior or significantly impacts performance (priority) and removed needs triage Issue needs to be triaged labels Mar 20, 2024
@matthewp matthewp self-assigned this Mar 20, 2024
@matthewp
Copy link
Contributor

Yeah, I'm working on fixing this. It tells you to deprecate the new column/table rather than the old one. Will try to make this explanation much more clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants