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 triaged this task as High priority.Nov 10 2018, 4:27 PM
matt created this task.
matt created this object with visibility "Public (No Login Required)".
matt moved this task from Backlog to Soon / v1.0 on the WriteFreely board.

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

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

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

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