Skip to content
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

V2 migrations not run on new instance #92

ghost opened this issue Apr 14, 2019 · 1 comment

V2 migrations not run on new instance #92

ghost opened this issue Apr 14, 2019 · 1 comment


Copy link

@ghost ghost commented Apr 14, 2019

Describe the bug

V2 migrations (altering the appcontent table) is not applied during init-db; migrations table claims it is V2 though.

MariaDB [writefreely]> describe appcontent;
| Field   | Type        | Null | Key | Default             | Extra |
| id      | varchar(36) | NO   | PRI | NULL                |       |
| content | mediumtext  | NO   |     | NULL                |       |
| updated | datetime    | NO   |     | current_timestamp() |       |
MariaDB [writefreely]> select * from appmigrations;
| version | migrated            | result |
|       2 | 2019-04-14 20:29:53 |        |

Steps to reproduce (if necessary)

  1. Create an empty database
  2. Point config to empty database
  3. writefreely -init-db

Expected behavior

V2 migrations were run and appcontent has title and content_type columns.

Application configuration

  • Single mode or Multi-user mode? Multi
  • Database? [mysql/sqlite] mysql
  • Open registration? [yes/no] yes
  • Federation enabled? [yes/no] yes

Version or last commit:
WriteFreely 0.9.0


update appmigrations set version=1;

@thebaer thebaer self-assigned this Apr 15, 2019
Copy link

@thebaer thebaer commented Apr 15, 2019

Thanks for the report! Forgot to update the schema files 😞

I think this would be a good time to keep all schema changes in the migrations module, so we don't have to worry about this in the future. While I work on a fix, to clarify, the workaround is to first run this database query:

UPDATE appmigrations SET version=1;

Then run this command:

writefreely --migrate


@thebaer thebaer closed this in 771c7ac Apr 15, 2019
@thebaer thebaer added this to the 0.9.1 milestone Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant