You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added database diff to the psake script
Removed unused skipfilenamescontaining and filefilterservice code
Added logging to changescriptexecutor to show if a script is running in
a transaction
Cleaned up namespaces
Added testdata unit tests
Database baseliner tests in progress
Copy file name to clipboardexpand all lines: README.md
+7-3
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Logs to usd_AppliedDatabaseScript
19
19
AliaSQL.exe Create .\sqlexpress ./scripts
20
20
```
21
21
22
-
Run all scripts in Create and Update folders that have not yet been ran - expects database to already exist.
22
+
Run all scripts in Create and Update folders that have not yet been ran. If target database does not already exist it will be created.
23
23
Logs to usd_AppliedDatabaseScript
24
24
```dos
25
25
AliaSQL.exe Update .\sqlexpress ./scripts
@@ -31,13 +31,13 @@ Logs to usd_AppliedDatabaseScript
31
31
AliaSQL.exe Rebuild .\sqlexpress ./scripts
32
32
```
33
33
34
-
Run all scripts in TestData folder that has yet been ran - expects database to already exist.
34
+
Run all scripts in TestData folder that have not yet been ran - expects target database to already exist.
35
35
Logs to usd_AppliedDatabaseTestDataScript
36
36
```dos
37
37
AliaSQL.exe TestData .\sqlexpress ./scripts
38
38
```
39
39
40
-
Logs but does not execute all scripts in Create and Update folders that have not yet been ran - expects database to already exist. This is to add the usd_AppliedDatabaseScript table and a record of all scripts to a legacy database.
40
+
Logs (but does not execute) all scripts in Create and Update folders that have not yet been ran - expects database to already exist. This adds the usd_AppliedDatabaseScript table and a record of all scripts to an existing database.
41
41
Logs to usd_AppliedDatabaseScript
42
42
```dos
43
43
AliaSQL.exe Baseline .\sqlexpress ./scripts
@@ -52,6 +52,10 @@ Install it via Nuget at *Coming Soon* or download it via Github releases at http
52
52
53
53
I like to create a console application in my solution that contains the Create/Update/Seed folders and a simple program to execute AliaSQL.exe from Visual Studio. Here is an example of this https://github.com/ericdc1/AliaSQL/blob/master/source/Database.Demo/Program.cs There is a Nuget package that will set it up with the necessary folders and the program in a (hopefully empty) console application to make this as easy as possible.
54
54
55
+
There is an example database console application with sample scripts available in the source. It includes helper batch files to Rebuild, Update, and populate Test Data to the Demo database.
56
+
57
+
There is also a database diff batch file that will compare the Demo database against the current set of Create and Update scripts and will generate a .sql file with the schema changes. Redgate SQL Compare is the better choice but this is free using SQLPackage.exe that comes with SQL Server Express.
58
+
55
59
Nuget package: *Coming Soon*
56
60
57
61
Latest compiled version can be found here: https://github.com/ericdc1/AliaSQL/raw/master/nuget/content/scripts/AliaSQL.exe
write-host"No schema changes found for $datebase_name"-foregroundcolor "green"
183
+
}
184
+
else
185
+
{
186
+
write-host"Please validate the new script $databaseScriptsUpdate\$newScriptName is correct, then rename to .sql and add to the database project"-foregroundcolor "yellow"
//UPDATE STATISTICS can be used inside an explicit transaction. However, UPDATE STATISTICS commits independently of the enclosing transaction and cannot be rolled back.
?string.Format(" while skipping file containing {0}",taskAttributes.SkipFileNameContaining)
17
-
:string.Empty;
18
-
19
-
varlogMessage=string.Format("{0} {1} on {2}{3}{4}\n",taskAttributes.RequestedDatabaseAction,taskAttributes.ConnectionSettings.Database,taskAttributes.ConnectionSettings.Server,scriptFolder,skipFiles);
15
+
varlogMessage=string.Format("{0} {1} on {2}{3}\n",taskAttributes.RequestedDatabaseAction,taskAttributes.ConnectionSettings.Database,taskAttributes.ConnectionSettings.Server,scriptFolder);
0 commit comments