forked from linq2db/linq2db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAv-InitDatabases.ps1
39 lines (30 loc) · 1.14 KB
/
Av-InitDatabases.ps1
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
param ([string]$conf="")
if ($conf -eq "mono")
{
Rename-Item Tests\Linq\MonoAppveyorDataProviders.txt UserDataProviders.txt
Rename-Item Tests\Linq\AppveyorDataProviders.Core.txt UserDataProviders.Core.txt
}
else
{
Rename-Item Tests\Linq\AppveyorDataProviders.txt UserDataProviders.txt
Rename-Item Tests\Linq\AppveyorDataProviders.Core.txt UserDataProviders.Core.txt
}
$startPath = "$($env:appveyor_build_folder)\Data"
$sqlInstance = "(local)\SQL2012SP1"
$dbName = "TestData"
# create database
sqlcmd -S "$sqlInstance" -Q "Use [master]; CREATE DATABASE [$dbName]"
#$mdfFile = join-path $startPath "northwnd.mdf"
#$ldfFile = join-path $startPath "northwnd.ldf"
#Write-Host "mdfFile : $mdfFile "
#Write-Host "ldfFile : $ldfFile "
#sqlcmd -S "$sqlInstance" -Q "Use [master]; CREATE DATABASE [Northwind] ON (FILENAME = '$mdfFile'),(FILENAME = '$ldfFile') for ATTACH"
# MySql
$env:MYSQL_PWD="Password12!"
$cmd = '"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql" -e "create database $dbName;" --user=root'
iex "& $cmd"
# PgSql
$env:PGUSER="postgres"
$env:PGPASSWORD="Password12!"
$cmd = '"C:\Program Files\PostgreSQL\9.3\bin\createdb" $dbName'
iex "& $cmd"