1
1
using System ;
2
+ using Microsoft . Data . Sqlite ;
2
3
3
- namespace SQLiteSampleApplication
4
+ namespace SqliteSampleApplication
4
5
{
5
6
public static class Program
6
7
{
@@ -13,11 +14,11 @@ static void Main()
13
14
14
15
static void InMemoryDb ( )
15
16
{
16
- using ( var database = new DbUp . SQLite . Helpers . InMemorySQLiteDatabase ( ) )
17
+ using ( var database = new DbUp . Sqlite . Helpers . InMemorySqliteDatabase ( ) )
17
18
{
18
19
var upgrader =
19
20
DbUp . DeployChanges . To
20
- . SQLiteDatabase ( database . ConnectionString )
21
+ . SqliteDatabase ( database . ConnectionString )
21
22
. WithScriptsEmbeddedInAssembly ( System . Reflection . Assembly . GetExecutingAssembly ( ) )
22
23
. LogToConsole ( )
23
24
. Build ( ) ;
@@ -34,11 +35,11 @@ static void InMemoryDb()
34
35
35
36
static void TemporaryFileDb ( )
36
37
{
37
- using ( var database = new DbUp . SQLite . Helpers . TemporarySQLiteDatabase ( "test.db" ) )
38
+ using ( var database = new DbUp . Sqlite . Helpers . TemporarySqliteDatabase ( "test.db" ) )
38
39
{
39
40
var upgrader =
40
41
DbUp . DeployChanges . To
41
- . SQLiteDatabase ( database . SharedConnection )
42
+ . SqliteDatabase ( database . SharedConnection )
42
43
. WithScriptsEmbeddedInAssembly ( System . Reflection . Assembly . GetExecutingAssembly ( ) )
43
44
. LogToConsole ( )
44
45
. Build ( ) ;
@@ -55,13 +56,13 @@ static void TemporaryFileDb()
55
56
56
57
static void PermanentFileDb ( )
57
58
{
58
- Microsoft . Data . Sqlite . SqliteConnection connection = new ( "Data Source=dbup.db" ) ;
59
+ SqliteConnection connection = new ( "Data Source=dbup.db" ) ;
59
60
60
- using ( var database = new DbUp . SQLite . Helpers . SharedConnection ( connection ) )
61
+ using ( var database = new DbUp . Sqlite . Helpers . SharedConnection ( connection ) )
61
62
{
62
63
var upgrader = DbUp . DeployChanges
63
64
. To
64
- . SQLiteDatabase ( connection . ConnectionString )
65
+ . SqliteDatabase ( connection . ConnectionString )
65
66
. WithScriptsEmbeddedInAssembly ( System . Reflection . Assembly . GetExecutingAssembly ( ) )
66
67
. LogToConsole ( )
67
68
. Build ( ) ;
@@ -87,15 +88,17 @@ static void Display(string dbType, DbUp.Engine.DatabaseUpgradeResult result, Tim
87
88
"{0} Database Upgrade Runtime: {1}" ,
88
89
dbType ,
89
90
string . Format ( "{0:00}:{1:00}:{2:00}.{3:00}" , ts . Hours , ts . Minutes , ts . Seconds , ts . Milliseconds / 10 ) ) ;
91
+ Console . WriteLine ( "Press any key to continue..." ) ;
90
92
Console . ReadKey ( ) ;
91
93
}
92
94
else
93
95
{
94
96
Console . ForegroundColor = ConsoleColor . Red ;
95
97
Console . WriteLine ( result . Error ) ;
98
+ Console . WriteLine ( "Press any key to continue..." ) ;
96
99
Console . ReadKey ( ) ;
97
100
Console . WriteLine ( "Failed!" ) ;
98
101
}
99
102
}
100
103
}
101
- }
104
+ }
0 commit comments