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

Add docs for new migrate:unlock command #266

Merged
merged 1 commit into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ export default class Sidebar extends Component {
<ii>- <a href="#Migrations-down">down</a></ii>
<li>– <a href="#Migrations-currentVersion">currentVersion</a></li>
<li>– <a href="#Migrations-list">list</a></li>
<li>– <a href="#Migrations-unlock">unlock</a></li>
<li><a href="#Notes-about-locks"><b>Notes about locks</b></a></li>
<li><a href="#Seeds-API"><b>Seed API</b></a></li>
<li>– <a href="#Seeds-make">make</a></li>
Expand Down
14 changes: 13 additions & 1 deletion sections/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down