-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

At coderanger's suggestion, I set up four trac instances to track
three parts of a project, plus a meta-project, which is our group's
project/corporate documentation, itself another SVN repository.

Putting it all into a single SVN repository doesn't make sense, and
we also expect to have to track the linux kernel as well, and that will
be git, not SVN as well.

(We had an existing pair of instances that we were using on another
machine with sqlite3)

I had thought that I needed something like multitrac or tracforge.

Instead, I setup each instance to use postgres, and to use a schema, via
a URL like:
      postgres://$one:$pw@/trac?schema=$one

(having created database "trac", and installed a copy of the set of
tickets,reports,milestones that we wanted into the public schema)

pw  = password
one = name of instance

The basic sequence was:

set -e
set -u

one=$1

dir=/trac/etc/projects/$one
mkdir -p $dir
pw=`pwgen -1`
echo Please enter pw: $pw
su postgres -c "dropuser $one"
su postgres -c "createuser --no-createrole --no-createdb --no-superuser -P $one"
su postgres -c "psql trac -c \"create schema $one\" authorization $one"

#initenv <projectname> <db> <repostype> <repospath>
trac-admin $dir initenv $one postgres://$one:$pw@/trac?schema=$one svn 
/repo/thing/$one

then after letting the system start up and confirming that it was
present when I looked at with a web browser, I went in and dropped the
tables from the relevant schemas.

This wasn't patch free because the code resets the search_path on me.
I'm not sure why it does that... the default search_path is $user,public.

navajo-[/trac/src/trac] mcr 1070 %svn diff
Index: trac/db/postgres_backend.py
===================================================================
- --- trac/db/postgres_backend.py (revision 5851)
+++ trac/db/postgres_backend.py (working copy)
@@ -66,7 +66,7 @@
         cursor = cnx.cursor()
         if cnx.schema:
             cursor.execute('CREATE SCHEMA "%s"' % cnx.schema)
- -            cursor.execute('SET search_path TO %s', (cnx.schema,))
+            cursor.execute('SET search_path TO %s,public', (cnx.schema,))
         from trac.db_default import schema
         for table in schema:
             for stmt in self.to_sql(table):
@@ -139,11 +139,13 @@
             PgSQL.noPostgresCursor = 1
             cnx = PgSQL.connect('', user, password, host, path, port, 
                                 client_encoding='utf-8', unicode_results=True)
+           #f = open("/var/tmp/thinctrac.txt","a")
+           #cnx.trace(f)
         try:
             self.schema = None
             if 'schema' in params:
                 self.schema = params['schema']
- -                cnx.cursor().execute('SET search_path TO %s', (self.schema,))
+                cnx.cursor().execute('SET search_path TO %s,public', 
(self.schema,))
         except PGSchemaError:
             cnx.rollback()
         ConnectionWrapper.__init__(self, cnx)
@@ -171,6 +173,6 @@
         self.cnx.rollback()
         if self.schema:
             try:
- -                self.cnx.cursor().execute("SET search_path TO %s", 
(self.schema,))
+                self.cnx.cursor().execute("SET search_path TO %s,public", 
(self.schema,))
             except PGSchemaError:
                 self.cnx.rollback()


- -- 
[EMAIL PROTECTED] / [EMAIL PROTECTED]
XDS Inc, Ottawa, ON             
Personal: http://www.sandelman.ca/mcr/ 


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Finger me for keys

iQEVAwUBRrjdMICLcPvd0N1lAQIz2gf9FeUXx/RS1VHLwRhGDSqGDPPdI6DWJU5i
dCTVLNSQBZWvKAIiDmiUeEtQ2nZYCGgZttr9geoDXmoU0JT2yK0ALQuQcJRWicB4
G50q+eRaTtW50EBMxNCULGz3e5bgcQ6eKFQ4v7/EvD4jhFOMI1BNwEsOAWyz6oSr
6NVdBcVGc0Y0Gl0hNf93X4BsHGQSMUOd4OJvyIyPVInoLtONDu+qu+MVse48JTXN
+uLROl8nBK1Hma0+Cj6oULq+zPTxYnu8UYU9UcNphwGoCx1BWw+qGd8AxGQqSYtO
4gUXFUX86rX6uGRqDahJUMnLD28qMYc81YFZpLySk5oY6wpWJrim2g==
=ooW5
-----END PGP SIGNATURE-----

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to