[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Demexp-dev] installation of new test site, and postgreSQL questions.
From: |
Augustin |
Subject: |
[Demexp-dev] installation of new test site, and postgreSQL questions. |
Date: |
Sat, 14 Oct 2006 14:57:56 +0800 |
User-agent: |
KMail/1.8.2 |
David,
On Saturday 14 October 2006 03:49 am, David MENTRE wrote:
> I'll spend following days playing the ouvaton.demexp.org site and try to
> build the Drupal interface on my machine.
Don't make it ouvaton.demexp.org! People are confused enough as it is! :)
ouvaton.demexp.org, demexp.ouvaton.org...?
Ouvaton is my host (do you this this coop?).
Make it test.demexp.org instead, which is much more evocative.
You can install Drupal on your test web site, but not yet demexp.module.
Before you can install the module, I have a few things to do.
1) I need to update and publish the INSTALL.txt file. There are some tricky
points to be careful about, when installing.
2) the demexp.install is not complete. There is the installation schema for
mysql, but the pgsql schema is currently empty. I must complete it. (see
below).
3) Why don't I install it, instead of you? It's the perfect opportunity for me
to learn how to use ssh to install the site. I think you are busy enough, and
that's part of my job.
I create three tables in demexp.install.
Here is one example. I need to translate this from mysql to postgresql:
(the {} in the table name are replaced my a prefix).
CREATE TABLE {demexp_questions} (
`ds_question_id` INT UNSIGNED NOT NULL DEFAULT '0',
`nid` INT (10) UNSIGNED NOT NULL DEFAULT '0',
`forum_tid` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0',
`ds_question` text NOT NULL,
`ds_timestamp` INT NOT NULL DEFAULT '0' ,
PRIMARY KEY ( `ds_question_id` ),
KEY nid (nid),
KEY forum_tid (forum_tid),
FULLTEXT KEY `ds_question` (`ds_question`)
) /*!40100 DEFAULT CHARACTER SET UTF8 */
Would the following work for pg?
CREATE TABLE {demexp_questions} (
ds_question_id smallint NOT NULL DEFAULT '0' CHECK (ds_question_id >=
0),
nid smallint NOT NULL DEFAULT '0' CHECK (nid >= 0),
forum_tid smallint NOT NULL DEFAULT '0' CHECK (forum_tid >= 0),
ds_question text NOT NULL DEFAULT '',
ds_timestamp integer NOT NULL DEFAULT '0' ,
PRIMARY KEY ( ds_question_id ),
KEY nid (nid),
KEY forum_tid (forum_tid),
FULLTEXT KEY `ds_question` (`ds_question`)
)
Also, the only weird query I have it to find the relationships between tags
(hierarchy). The query I use is:
SELECT * FROM {demexp_tags} WHERE LEFT(tag_hierarchy, %d) = '%s' AND
LENGTH(tag_hierarchy) = %d
where %d and %s will be replaced by integers and strings respectively.
Do you have the functions LEFT() and LENGTH defined in pgsql?
If not, can they be created, and put back as part of the demexp.install?
I notice that the core of Drupal has plenty of those. See in
modules/system/system.install; there are many like these:
CREATE OR REPLACE FUNCTION "if"(boolean, text, text) RETURNS text AS
\'SELECT CASE WHEN $1 THEN $2 ELSE $3 END;\'
LANGUAGE \'sql\''
SELECT COUNT(*) FROM pg_proc WHERE proname = 'concat'"))) {
db_query('CREATE OR REPLACE FUNCTION "concat"(text, text) RETURNS text
AS \'SELECT $1 || $2;\'
LANGUAGE \'sql\''
Augustin.
--
http://www.wechange.org/
Because we and the world need to change.
http://www.reuniting.info/
Intimate Relationships, peace and harmony in the couple.
http://www.gnosis-usa.com/
Revolutionary Psychology, White Tantrism, Dream Yoga...
http://www.masquilier.org/
Condorcet, Approval alternative, better voting methods.