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

fix: migration syntax and insert query #2597

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zinderic
Copy link

I noticed that the example was not working because the migration could not run:

sqlite> CREATE TABLE IF NOT EXISTS google_tokens (
(x1...>   id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
(x1...>   user_id INTEGER NOT NULL UNIQUE,
(x1...>   access_secret TEXT NOT NULL,
(x1...>   refresh_secret TEXT NOT NULL,
(x1...>   created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
(x1...>   FOREIGN KEY (user_id) REFERENCES users(id) CONFLICT REPLACE
(x1...> );
Parse error: near "CONFLICT": syntax error
  AMP,   FOREIGN KEY (user_id) REFERENCES users(id) CONFLICT REPLACE );
                                      error here ---^
sqlite> 

Moving that conflict resolution to the insert query seems to work fine.

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.

None yet

1 participant