Import schema
Closed, ResolvedPublic



Make installation easier by creating necessary tables automatically when the app starts up.

Let users initialize the database with a command in the app.


Check for some default table that won't change, like collections, posts, app or app_config. If it doesn't exist, run schema.sql.

Ideally, we should embed schema.sql into the binary when we build a release, so there are fewer files laying around.

Event Timeline

matt created this task.Nov 10 2018, 4:27 PM
matt created this object with visibility "Public (No Login Required)".
matt moved this task from Far Future to Soon on the WriteFreely board.
matt triaged this task as High priority.
matt added a comment.Nov 13 2018, 6:33 PM

Looking at a way to include schema.sql in the binary now. So many libraries to pick from...

matt added a comment.Nov 13 2018, 7:56 PM

That latest change still needs schema.sql in the same folder, but adds the option to create tables with writefreely --init-db

matt updated the task description. (Show Details)Dec 11 2018, 3:59 PM
matt renamed this task from Create database tables on startup to Import schema.
matt closed this task as Resolved.

Remaining work here is mentioned in T536: Compile all static / default assets into binary.