Skip to content

Commit 874fd8d

Browse files
authored
Add TagBehavior option details
Added details on using the TagBehavior.Any enum in order to enable migrations to run that are focused on specific tags.
1 parent 20206bb commit 874fd8d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

articles/migration/migration-filter-tags.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ Tags are assigned to migrations with an attribute/s:
2323
public class DoSomeStuffToEuropeanStagingAndProdDbs : Migration { /* ... etc ... */ }
2424
```
2525

26+
# Tag Matching Behavior
27+
28+
By default, FluentMigrator only runs migrations that have no tags or whose tags match all of the tags passed in to the runner. Another option that can be used is passing in the `TagBehavior.Any` enum to the `[Tags]` attribute so that the migration will run if any of the tags defined in the attribute match those passed into the runner.
29+
30+
```cs
31+
[Tags(TagBehavior.Any, "UK")]
32+
[Migration(2)]
33+
public class DoSomethingToUnitedKingdomDbs : Migration { /* ... etc ... */ }
34+
```
35+
2636
# Inheriting Migration Tags
2737

2838
Tag inheritance can apply to both base classes (single-inheritance) and interfaces (multiple-inheritance).

0 commit comments

Comments
 (0)