From 42a9136d208ebcaa65ae5d6cf6625b94147a6c03 Mon Sep 17 00:00:00 2001 From: Zach McElrath Date: Thu, 23 Apr 2020 07:35:33 -0400 Subject: [PATCH] Add docs for new migrate:unlock command Corresponding knex PR: https://github.com/knex/knex/pull/3822 --- components/Sidebar.jsx | 1 + sections/migrations.js | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/components/Sidebar.jsx b/components/Sidebar.jsx index 74900956..e3a193c3 100644 --- a/components/Sidebar.jsx +++ b/components/Sidebar.jsx @@ -291,6 +291,7 @@ export default class Sidebar extends Component { - down
  • currentVersion
  • list
  • +
  • unlock
  • Notes about locks
  • Seed API
  • make
  • diff --git a/sections/migrations.js b/sections/migrations.js index 303468bc..82a1c121 100644 --- a/sections/migrations.js +++ b/sections/migrations.js @@ -542,6 +542,13 @@ export default [ description: "Will return list of completed and pending migrations", children: [] }, + { + type: "method", + method: "unlock", + example: "knex.migrate.forceFreeMigrationsLock([config])", + description: "Forcibly unlocks the migrations lock table, and ensures that there is only one row in it.", + children: [] + }, { type: "heading", size: "md", @@ -556,7 +563,12 @@ export default [ { type: "text", content: - 'Please note that if your process unfortunately crashes, the lock will have to be *manually* removed in order to let migrations run again. The locks are saved in a table called "`tableName`_lock"; it has a column called `is_locked` that you need to set to `0` in order to release the lock. The `index` column in the lock table exists for compatibility with some database clusters that require a primary key, but is otherwise unused.' + 'Please note that if your process unfortunately crashes, the lock will have to be *manually* removed with `knex migrate:unlock` in order to let migrations run again.' + }, + { + type: "text", + content: + 'The locks are saved in a table called "`tableName`_lock"; it has a column called `is_locked` that `knex migrate:unlock` sets to `0` in order to release the lock. The `index` column in the lock table exists for compatibility with some database clusters that require a primary key, but is otherwise unused. There must be only one row in this table, or an error will be thrown when running migrations: "Migration table is already locked". Run `knex migrate:unlock` to ensure that there is only one row in the table.' }, { type: "heading",