fix: check if the Article table exists#45
Conversation
|
Stupid questions: Did you open manually with sqlitebrowser the .db file first? If it works manually then you could use docker compose down -v and docker compose up again. |
|
I saw the issue, nice catch, the idea is to keep updated the sql structure in the .dist file, we should do it sooner or later |
|
I did some tests locally, I don't think that this code is really necessary, ERSU.db.dist has already the Article table apparently, it does not need this code, I would keep it to prevent any issues. Possibly, the docker image in the github docker hub (ghcr) was not updated yet and you were using the old image instead of the new one. |
I was building the image locally, so actually idk why renaming the .db.dist did not work. but as you said it might prevent some issues so it is not 100% useless |
While following the Testing with Docker Compose I encountered an error in the log:
even though I tried renaming the .db.dist database to .db I kept getting the same error
I also tried adding another -v parameter as in the Docker-compose file but I kept getting the same error
So i came up with this solution in order to check the
Articletable existance.Since the code is already checking for the existance of
UserSettingsandNewstables, I decided to putsetup_articlesfunction inside ofsetup_db()because it is related to that. I also decided to putsetup_articles()inside ofscraper.pyfor the same reason.