mirror of
https://github.com/go-shiori/shiori.git
synced 2026-04-25 06:25:54 +03:00
[GH-ISSUE #473] First start creates an empty database with no tables #286
Labels
No labels
component:backend
component:builds
component:builds
component:extension
component:frontend
component:readability
database
database:mysql
database:postgres
database:sqlite
feature:ebooks
github_actions
good first issue
hacktoberfest
note:duplicate?
note:fixed?
note:out-of-scope?
os:windows
priority:high
priority:low
pull-request
resolution:as-intended
resolution:cant-reproduce
resolution:duplicate
resolution:fixed
resolution:wontfix
tag:TBD
tag:big-task
tag:help-wanted
tag:huge-data
tag:meta
tag:more-info
tag:next
tag:no-stale
tag:requires-migrations
tag:research
tag:security 🛡️
tag:stale
tag:waiting-for-assignee
type:bug
type:documentation
type:enhancement
type:meta
type:ux
user:cli
user:web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shiori#286
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Katarn on GitHub (Aug 23, 2022).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/473
Originally assigned to: @fmartingr on GitHub.
I run:
And I see a zero size file
shiori.dbin theshiori-datadirectory:Open in browser, try to login
shiori/gopherand see:It works only if before the first start run:
I use shiori v1.5.3.
@Katarn commented on GitHub (Aug 24, 2022):
I found a description of this problem in the FAQ, but, IMHO, this is not user friendly. Perhaps it would be better if the application created the database itself?
@fmartingr commented on GitHub (Oct 12, 2022):
Hey @Katarn, please take a look at #512
@Katarn commented on GitHub (Oct 13, 2022):
@fmartingr Hello. But it still seems non-obvious to the end user. It seems to me. What is the purpose of migration if the previous version of the database does not yet exist?
@hulb commented on GitHub (Oct 14, 2022):
I think auto-migration is complicated and it's comon to initialize database schema in first migration.
@tetafro commented on GitHub (Oct 14, 2022):
At least it should be added to the installation docs.
(But personally I agree, that making automatically is better.)
@hulb commented on GitHub (Oct 14, 2022):
yeah, it would be more friendly for users.
@fmartingr commented on GitHub (Oct 14, 2022):
That only applies for SQLite, since for Mysql and PSQL you need to provide a database first, but the fact that the actual file in the filesystem does not exist for SQLite equals to a database being empty in Mysql/PSQL. The problem with not running the migration first is that the CLI will create the database file empty, since it expects a database there it will just create it. Maybe we could add an error since we are expecting a database file and telling the user to migrate? But how we will replicate this for the other engines? Should we give an error too if the user has not migrated to the latest schema?
I'm unsure about this, for me, having to migrate schemas is the 101 for backend services, but maybe I'm focusing too much on the engineer side and not on a less tech-savvy user side?
The other problem I see with automatic migrations is that we have very little tests at the moment, and if I ever do something like that I want to have assurances that we don't break things between releases.
And, just because there wasn't enough complexity here, there's the thing that we have three types of users: 1) the ones who use the webui (and the extension), 2) the ones who use the CLI, 3) the ones who use both. I would understand the CLI users to expect things to work magically, but not so much from the service users.
Please, provide your feedback for this, as I don't want to create unnecessary friction for the users.
Yeah, documentation needs a bit of love. I would gladly accepts PRs for this! :)
@Katarn commented on GitHub (Oct 16, 2022):
@fmartingr It seems obvious to me that if the SQLite database file does not exist or is zero size, the application should migrate automatically and then connect to it as usual.
The reason I'm considering the behavior for SQLite separately from other database engines is that when a user selects a SQLite, they mean that they want to start working right now without setting up a back-end database. As if it were a usual user-end application. As a rule, he does not know what migration is, and he is not interested in it - this is a programmer's term. He may not understand databases at all as such.
In any case, from my point of view, using one binary (thanks Go) in conjunction with the SQLite makes the application so easy to use that housewives can use it. And the understanding of migration is already the next levels of computer skills.
@fmartingr commented on GitHub (Oct 28, 2022):
You are totally right on that. I mostly focus on the server side of the spectrum where migrations are a common thing, but it's true that when using CLI users shouldn't require this kind of knowledge and/or steps. I will give this a thought but I may probably either revert the migration changes or just make a
--no-migrateflag for users that want to tackle that on their own (though once you have something automatic that need is pretty unlikely).Don't expect this change soon ™️ , as I've just started on a new position and I'm fairly busy with that and other things, but if any of you want to tackle this I will try to keep PRs checked every few days so I don't have a huge backlog of things to do once I have some "free" time 🙃
@Katarn commented on GitHub (Oct 28, 2022):
It's great that we finally understand each other. Unfortunately, I don't know Go at all, so I can't help much.
Good luck in your new position!
@sergeevabc commented on GitHub (Nov 13, 2022):
@Katarn, thank you for brining this up. Shiori's first-time use is so messed up.