Skip to content

Commit be96861

Browse files
committed
Added installation instructions for PostgreSQL server.
SVN: trunk@5410
1 parent 487a3f1 commit be96861

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+

src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.cs

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Data.SqlClient;
4+
using System.IO;
5+
using FirebirdSql.Data.FirebirdClient;
46
using Npgsql;
57
using NUnit.Framework;
6-
using FirebirdSql.Data.FirebirdClient;
78

89
namespace NHibernate.TestDatabaseSetup
910
{
@@ -51,8 +52,9 @@ private static void SetupSqlServer(Cfg.Configuration cfg)
5152
{
5253
cmd.ExecuteNonQuery();
5354
}
54-
catch(Exception)
55+
catch(Exception e)
5556
{
57+
Console.WriteLine(e);
5658
}
5759

5860
cmd.CommandText = "create database nhibernate";
@@ -63,6 +65,16 @@ private static void SetupSqlServer(Cfg.Configuration cfg)
6365

6466
private static void SetupFirebird(Cfg.Configuration cfg)
6567
{
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+
6678
FbConnection.CreateDatabase("Database=NHibernate.fdb;ServerType=1");
6779
}
6880

@@ -82,8 +94,9 @@ private static void SetupNpgsql(Cfg.Configuration cfg)
8294
{
8395
cmd.ExecuteNonQuery();
8496
}
85-
catch (Exception)
97+
catch (Exception e)
8698
{
99+
Console.WriteLine(e);
87100
}
88101

89102
cmd.CommandText = "create database nhibernate";

teamcity.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
<property name="nunit.found" value="true" />
9797
<property name="nhibernate.connection.driver_class" value="NHibernate.Driver.NpgsqlDriver" />
9898
<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" />
100100
<copy todir="${bin.dir}">
101101
<fileset basedir="${root.dir}/lib/teamcity/postgresql">
102102
<include name="*.dll"/>

0 commit comments

Comments
 (0)