File tree 3 files changed +33
-4
lines changed
src/NHibernate.TestDatabaseSetup
3 files changed +33
-4
lines changed Original file line number Diff line number Diff line change
1
+
2
+ Installation steps for PostgreSQL for NH TeamCity:
3
+
4
+ 1. Download PostgreSQL (postgresql-9.0.3-1-windows_x64.exe): http://www.enterprisedb.com/products-services-training/pgdownload#windows;
5
+ 2. Run the installer ... when prompted to make a password for the service account, make it 'password';
6
+ 3. Leave the port number at the default (5432), and leave the default locale;
7
+ 4. The setup should install PostgreSQL on the machine;
8
+ 5. Untick the option to install stack-builder at the end (it's not required).
9
+
10
+ Creating the NH user:
11
+
12
+ a. Open pgAdmin III (start -> programs -> PostgreSQL 9.0 -> pgAdmin III);
13
+ b. right-click the PostgreSQL 9.0 database, select connect, and enter the password from step 2 above;
14
+ c. right-clilck the Login Roles, and select "New Login Role ...";
15
+ d. create a login with "Role name=nhibernate", "Password=nhibernate", and select Superuser on the Role privileges tab.
16
+
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections . Generic ;
3
3
using System . Data . SqlClient ;
4
+ using System . IO ;
5
+ using FirebirdSql . Data . FirebirdClient ;
4
6
using Npgsql ;
5
7
using NUnit . Framework ;
6
- using FirebirdSql . Data . FirebirdClient ;
7
8
8
9
namespace NHibernate . TestDatabaseSetup
9
10
{
@@ -51,8 +52,9 @@ private static void SetupSqlServer(Cfg.Configuration cfg)
51
52
{
52
53
cmd . ExecuteNonQuery ( ) ;
53
54
}
54
- catch ( Exception )
55
+ catch ( Exception e )
55
56
{
57
+ Console . WriteLine ( e ) ;
56
58
}
57
59
58
60
cmd . CommandText = "create database nhibernate" ;
@@ -63,6 +65,16 @@ private static void SetupSqlServer(Cfg.Configuration cfg)
63
65
64
66
private static void SetupFirebird ( Cfg . Configuration cfg )
65
67
{
68
+ try
69
+ {
70
+ if ( File . Exists ( "NHibernate.fdb" ) )
71
+ File . Delete ( "NHibernate.fdb" ) ;
72
+ }
73
+ catch ( Exception e )
74
+ {
75
+ Console . WriteLine ( e ) ;
76
+ }
77
+
66
78
FbConnection . CreateDatabase ( "Database=NHibernate.fdb;ServerType=1" ) ;
67
79
}
68
80
@@ -82,8 +94,9 @@ private static void SetupNpgsql(Cfg.Configuration cfg)
82
94
{
83
95
cmd . ExecuteNonQuery ( ) ;
84
96
}
85
- catch ( Exception )
97
+ catch ( Exception e )
86
98
{
99
+ Console . WriteLine ( e ) ;
87
100
}
88
101
89
102
cmd . CommandText = "create database nhibernate" ;
Original file line number Diff line number Diff line change 96
96
<property name =" nunit.found" value =" true" />
97
97
<property name =" nhibernate.connection.driver_class" value=" NHibernate.Driver.NpgsqlDriver" />
98
98
<property name =" nhibernate.dialect" value=" NHibernate.Dialect.PostgreSQL82Dialect" />
99
- <property name =" nhibernate.connection.connection_string" value=" Host=localhost;Port=5433 ;Database=nhibernate;Username=nhibernate;Password=nhdbpass " />
99
+ <property name =" nhibernate.connection.connection_string" value=" Host=localhost;Port=5432 ;Database=nhibernate;Username=nhibernate;Password=nhibernate " />
100
100
<copy todir =" ${bin.dir}" >
101
101
<fileset basedir =" ${root.dir}/lib/teamcity/postgresql" >
102
102
<include name =" *.dll" />
You can’t perform that action at this time.
0 commit comments