FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Installation Issues » Postgres: Intstalling in non-public schema?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Postgres: Intstalling in non-public schema? [message #36018 is a reply to message #35999] Wed, 28 February 2007 11:04 Go to previous messageGo to previous message
Drezil is currently offline  Drezil   Germany
Messages: 7
Registered: February 2007
Karma:
Junior Member
yup.. worked fine - as far as i can see..
what i did in detail (for those who plan the same thing):

1. install ff in an empty database with your designated prefix (i.e. fud26_)(can't be omitted due to internal stuff i think)
2. dump the structure with all data and edit it "manually" and replace "fud26_" with "forum.fud26_" (if you ward the forum schema)
keep in mind not to replace the indexes/constraints ("index fud26_bla" must be kept that way. dont replace it to "index forum.fud26_bla")
3. restore the changed db-structure into your schema.
4. edit the ff-files.
you have to replace all occourences of "fud26_" with "forum.fud26_" in /var/www/forum (or whereever your forum-root may be) and in /var/FUDforum/... (by default). (i did it manually by downloading the whole bunch ind changing it with a tool in windows .. Wink )
this litte line should work too (being in one of the 2 given dirs):
find -type f -exec sed -e 's/fud26_/forum.fud26_/' -i {} \;

(not tested - be warned Wink )
5. adjust the GLOBALS.php to your needs (correct database, "forum.fud26_" as table-prefix) and enjoy, you're done.

all in all its a quite dirty solution.. the next time (if update failes for whetever reason) i'll change the installer so that it works. (i think it has something to do with the database-structure.. it seemed that all table-information (including indecies!) got the given table-prefix.. and because index schema.table doesn't work this could be the point why just adjusting the 2 regexes in the installer didn't work.)

edit: seems like there are some more difficulties, because ff creates tables dynamically (which is not a problem) with indices (wich is more a problem Wink ) leading to invalid sql (create index foo.bar is not allowed..).

--
as far as i can see (at this point) you made a bunch of sql-templates. I sum up, what i've understood of your forum:
1. sql is in sql-templates.
2. at runtime all expressions {EXPRESSION} are replaced by str_replace and the resulting query is executed.
I don't know how consistent jou followed this approach. If this is the case every time than this should help:
replace "{SQL_TABLE_PREFIX}" with "{SQL_TABLE_SCHEMA}{SQL_TABLE_PREFIX}" in all files.

the elegant way is then to replace all replacements with
str_replace('{SQL_TABLE_SCHEMA}tv_1', '.$GLOBALS['DBHOST_TBL_SCHEMA'].', $v)
str_replace('{SQL_TABLE_PREFIX}tv_1', $view_tbl, $v)

and add such a global var so that there is an extra option for the schema etc.

the quick&dirty nasty way is:
add the global as in the example before and change also the replacements to:
str_replace('{SQL_TABLE_SCHEMA}{SQL_TABLE_PREFIX}tv_1', $view_tbl, $v)
change all indices in the sql-templates so the create proper sql. then you get stuck with some {SQL_TABLE_PREFIX} not be replaced (the ones you just edited) so just add for this few cases an extra-replacement.

note: the quick& dirty-solution is really quick & dirty ..

can you give (maybe link or sth.) me a brief intro to the concept of design of the fudforum, so i can edit it for myself and send you a "corrected" version?
if you want to discuss this with me in detail (for example if jou want to include this feature for later versions or tell me that this is just way too complicated and i should go for myself) then feel free to contact me

irc: #mission-unknown @ irc.gamesurge.net (talk to Drezil, the channel-owner Wink )
icq: pm me
jabber: pm me
mail: pm me
note: i live in germany (+6h to default-forum-time)

[Updated on: Thu, 01 March 2007 12:52]

Report message to a moderator

[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Two more issues...
Next Topic: Upgrade Errors
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Dec 18 03:31:15 GMT 2024

Total time taken to generate the page: 0.08652 seconds