/
IMigrateApi.cs
53 lines (47 loc) · 1.47 KB
/
IMigrateApi.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
using System;
namespace Sector
{
/// <summary>
/// An API for managing database schemas.
/// </summary>
public interface IMigrateApi
{
/// <summary>
/// Checks if a database is version controlled.
/// </summary>
/// <returns>
/// True if the DB is version controlled, false otherwise.
/// </returns>
/// <param name='repository'>
/// If set to <c>true</c> repository.
/// </param>
bool IsVersionControlled(IRepository repository);
/// <summary>
/// Attempt to version control the database, one should call
/// IsVersionControlled() first to make sure it's not already
/// version controlled.
/// </summary>
/// <param name='repository'>
/// Repository.
/// </param>
void VersionControl(IRepository repository);
/// <summary>
/// Gets the current db version.
/// </summary>
/// <returns>
/// The current db version.
/// </returns>
/// <param name='repository'>
/// Repository.
/// </param>
int GetDbVersion(IRepository repository);
/// <summary>
/// Upgrades to the version specified..
/// </summary>
void Upgrade(IRepository repository, int version);
/// <summary>
/// Downgrades to the version specified..
/// </summary>
void Downgrade(IRepository repository, int version);
}
}