From 87040845ed1ae78140b1c5cbb0d24abc232c26ce Mon Sep 17 00:00:00 2001 From: David-Wobrock Date: Mon, 4 May 2020 20:41:51 +0200 Subject: [PATCH] Fix #106 -- Add forgotten documentation about IgnoreMigration() --- CHANGELOG.md | 3 ++- docs/usage.md | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9596a8c..1992fef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 2.2.0 -* Make summary output more friendly (thanks @vald-phoenix) +* Make summary output more friendly (Thanks to @vald-phoenix) +* Add forgotten documentation about `IgnoreMigration` ## 2.1.0 diff --git a/docs/usage.md b/docs/usage.md index 6dbf227..57326eb 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -27,6 +27,23 @@ Detailed command line options: |`--quiet or -q {ok,ignore,warning,error}` | Suppress certain output messages, instead of writing them to stdout. | |`--warnings-as-errors` | Handle warnings as errors and therefore return an error status code if we should. | +## Ignoring migrations + +You can also ignore migrations by adding an `IgnoreMigration()` to your migration operations: +``` +from django.db import migrations, models +import django_migration_linter as linter + +class Migration(migrations.Migration): + dependencies = [...] + operations = [ + linter.IgnoreMigration(), + # ... + ] +``` + +Or you can restrict the migrations that should be selected by a file containing there paths with the `--include-migrations-from` option. + ## Ignoring migration tests You can also ignore backward incompatible migration tests by adding this option during execution: