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 with --force-reset doesn't seem to work. #10873

Closed
1 task
pMay2021 opened this issue Apr 25, 2024 · 2 comments
Closed
1 task

Astro DB: push with --force-reset doesn't seem to work. #10873

pMay2021 opened this issue Apr 25, 2024 · 2 comments
Labels
needs repro Issue needs a reproduction

Comments

@pMay2021
Copy link

Astro Info

Astro                    v4.6.4
Node                     v21.7.3
System                   macOS (arm64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/cloudflare
Integrations             @astrojs/tailwind
                         @astrojs/mdx
                         astro:db
                         @astrojs/db/file-url

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

No response

Describe the Bug

I've defined my tables in config.ts and have made some changes to them (though they really aren't breaking changes, as I'm adding some new columns but for some reason, the push kept failing). Since I'm in the early stages, I just want to reset and recreate the database.

The documentation says I should do npm run astro db push --remote --force-reset

but when I do that, I see the following messages:


> owdcom@0.0.1 astro
> astro db push

✔ Connected to remote database.
Database schema is out of date.
Pushing database schema updates...
https://db.services.astro.build/db/push failed: 400 Bad Request
{"success":false,"error":{"code":"SQL_QUERY_FAILED","details":"SQLITE_CONSTRAINT: SQLite error: FOREIGN KEY constraint failed"}}
/db/push fetch failed: 400 Bad Request

There are very few foreign keys, and they are all named and referenced correctly (and have not changed). With the generic error message, I cannot figure out where the issue lies.

I see the same whether I do --remote or --force-reset. It's as if the force-reset flag isn't being considered.

PS - I do not know if this is related to some of the db issues I've been seeing today and raised a separate ticket.

What's the expected result?

Create the tables per the new schema.

Link to Minimal Reproducible Example

db related

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 Apr 25, 2024
@matthewp
Copy link
Contributor

It is definitely possible that our logic to reset the db has bugs in it, but we can't help without a reproduction.

@matthewp matthewp added needs repro Issue needs a reproduction and removed needs triage Issue needs to be triaged labels Apr 25, 2024
Copy link
Contributor

Hello @pMay2021. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro will be closed if they have no activity within 3 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue needs a reproduction
Projects
None yet
Development

No branches or pull requests

2 participants