summaryrefslogtreecommitdiff
path: root/docs/content
diff options
context:
space:
mode:
authorDavid Mehren2021-03-04 20:33:30 +0100
committerGitHub2021-03-04 20:33:30 +0100
commit64a2fb8be71792e15b76fceeb948ddfc3c9de704 (patch)
tree4bf5d1771c172d052246530f76316b5b997dd9c0 /docs/content
parent6186e0f48f3414e9de4ab5f864c2d153aa995c51 (diff)
parentb47f1e80b43839de20591544dacd016822bacb63 (diff)
Merge pull request #969 from hedgedoc/feature/port_automated_migrations
Diffstat (limited to '')
-rw-r--r--docs/content/guides/migration-troubleshooting.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/docs/content/guides/migration-troubleshooting.md b/docs/content/guides/migration-troubleshooting.md
new file mode 100644
index 00000000..20532111
--- /dev/null
+++ b/docs/content/guides/migration-troubleshooting.md
@@ -0,0 +1,25 @@
+# Troubleshooting Migrations
+
+In some cases, HedgeDoc might apply migrations without correctly saving the progress.
+In these cases, HedgeDoc will refuse to start with “already exists”-errors like
+`ERROR: type "enum_Notes_permission" already exists`.
+
+To fix these issues, manual intervention in the database is required:
+
+1. Make sure you have a way to edit the database directly. For SQLite, PostgreSQL and MariaDB/MySQL, you can use the
+ respective command-line tools `sqlite3`, `psql` and `mysql`.
+2. Get the name of the failing migration and append `.js` to it.
+ For example, if you encounter this error
+ ```
+ == 20180306150303-fix-enum: migrating =======
+
+ ERROR: type "enum_Notes_permission" already exists
+ ```
+ the name of the failed migration would be `20180306150303-fix-enum.js`.
+3. Make sure HedgeDoc does not run and insert the name into the `SequelizeMeta` table.
+ Ensure your database shell is connected to the HedgeDoc database. The SQL-statement may look like this:
+ ```sql
+ INSERT INTO "SequelizeMeta" (name) VALUES ('20180306150303-fix-enum.js');
+ ```
+4. Start HedgeDoc again and observe if it starts correctly. It may be necessary to repeat this process
+ and insert multiple migrations into the `SequelizeMeta` table.