-
Notifications
You must be signed in to change notification settings - Fork 1
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
Schema incorrect since merging #8 #15
Comments
I can see two approaches to fixing this:
I've done a quick spike on the first approach, and it gets pretty complicated pretty quickly. Doing another spike on the second approach now. |
Track posts to Slack in new table. Fixes #15.
This appears fixed in morph.io now and I've run the scraper and it didn't post, reading from the existing data correctly. But, the all but the latest post has had the wrong runner applied to it (see [api results](https://api.morph.io/openaustralia/jacaranda/data.json?key=yourkeyuery=select * from "posts")):
Sorry @auxesis that's my fault for not checking the tests covered that parsing! I think the way to fix this is to add a temporary method to clear up that old data. We should then remove the schema upgrade methods too because they wont be relevant to other users. |
OK no worries @equivalentideas, I'll make another PR to test and fix this. |
Add method to fix incorrectly migrated data. Fixes #15.
Turns out you can't introduce a new
UNIQUE
constraint on an existing table that already has aUNIQUE
constraint.This is a problem for Jacaranda, because this is the old schema prior to merging #8:
And this is the new schema created from a dry run of #8, now there are multiple runners:
SQLite doesn't support adding new columns with
UNIQUE
orPRIMARY KEY
constraints to existing tables.SQLite does permit adding a unique index if your table has no existing
UNIQUE
constraints.The effect of this is:
This means that when the scraper gets run by Morph, it will post messages to Slack every day, because it doesn't know that the runner successfully ran the day before.
The text was updated successfully, but these errors were encountered: