generated from Avanade/avanade-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
MigrationCommand.cs
114 lines (94 loc) · 4.03 KB
/
MigrationCommand.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/DbEx
using System;
using DbEx.Migration;
namespace DbEx
{
/// <summary>
/// Represents the migration command, in that it controls the underlying migration tasks that are to be performed.
/// </summary>
[Flags]
public enum MigrationCommand
{
/// <summary>
/// Nothing specified.
/// </summary>
None = 0,
/// <summary>
/// Drop the existing database (where it already exists).
/// </summary>
Drop = 1,
/// <summary>
/// Create the database (where it does not already exist).
/// </summary>
Create = 2,
/// <summary>
/// Migrate the database using the <b>Migrations</b> scripts (those that have not already been executed).
/// </summary>
Migrate = 4,
/// <summary>
/// Generates the likes of database <b>Schema</b> objects via code-generation (where applicable).
/// </summary>
/// <remarks>The <see cref="DatabaseMigrationBase.IsCodeGenEnabled"/> must be set <c>true</c> to enable execution within the orchestration flow.</remarks>
CodeGen = 8,
/// <summary>
/// Drops and creates the known database <b>Schema</b> objects.
/// </summary>
/// <remarks>These are generally schema related artefacts that are applied as scripted on every invocation. These may be deleted (where underlying object is pre-existing) and then (re-)applied where object type is known.</remarks>
Schema = 16,
/// <summary>
/// Resets the database by deleting all existing data.
/// </summary>
/// <remarks>This is intended for development and testing purposes only; therefore, this should never be used in a production environment.</remarks>
Reset = 32,
/// <summary>
/// Inserts or merges <b>Data</b> from embedded YAML files.
/// </summary>
Data = 64,
/// <summary>
/// Performs <b>all</b> the primary commands as follows; <see cref="Create"/>, <see cref="Migrate"/>, <see cref="CodeGen"/>, <see cref="Schema"/> and <see cref="Data"/>.
/// </summary>
All = Create | Migrate | CodeGen | Schema | Data,
/// <summary>
/// Performs <see cref="Migrate"/> and <see cref="Schema"/>.
/// </summary>
Deploy = Migrate | Schema,
/// <summary>
/// Performs <see cref="Deploy"/> with <see cref="Data"/>.
/// </summary>
DeployWithData = Deploy | Data,
/// <summary>
/// Performs <see cref="Drop"/> and <see cref="All"/>.
/// </summary>
DropAndAll = Drop | All,
/// <summary>
/// Performs <see cref="Reset"/> and <see cref="All"/>.
/// </summary>
ResetAndAll = Reset | All,
/// <summary>
/// Performs only the <b>database</b> commands as follows: <see cref="Create"/>, <see cref="Migrate"/>, <see cref="Schema"/> and <see cref="Data"/>.
/// </summary>
Database = Create | Migrate | Schema | Data,
/// <summary>
/// Performs <see cref="Drop"/> and <see cref="Database"/>.
/// </summary>
DropAndDatabase = Drop | Database,
/// <summary>
/// Performs <see cref="Reset"/> and <see cref="Database"/>.
/// </summary>
ResetAndDatabase = Reset | Database,
/// <summary>
/// Performs <see cref="Reset"/> and <see cref="Data"/>.
/// </summary>
ResetAndData = Reset | Data,
/// <summary>
/// Executes the SQL statement(s) passed as additional arguments.
/// </summary>
/// <remarks>This can not be used with any of the other commands.</remarks>
Execute = 1024,
/// <summary>
/// Creates a new <see cref="Migrate">migration</see> script file using the defined naming convention.
/// </summary>
/// <remarks>This can not be used with any of the other commands.</remarks>
Script = 2048
}
}