26

Re: PunBB 1.2-dev (01 Nov) - Unable to create indexes

but if I put it in the install.php I get the same error again...

27

Re: PunBB 1.2-dev (01 Nov) - Unable to create indexes

me again, sorry...

as i said, i still get the error, but with phphmyadmin i can see, that some indexes have been created, so perhaps i m not totally wrong...
(screenshot http://se-fri.de/index.gif )

perhaps that helps...

28

Re: PunBB 1.2-dev (01 Nov) - Unable to create indexes

it works for me now (by using ALTER TABLE... ADD INDEX.. instead of CREATE INDEX)

    // Add a few indexes
    /*$queries[] = 'CREATE INDEX '.$db_prefix.'online_user_id_idx ON '.$db_prefix.'online(user_id)';*/
         $queries[] = 'ALTER TABLE '.$db_prefix.'online ADD INDEX online_user_id_idx ( user_id )';
    /*$queries[] = 'CREATE INDEX '.$db_prefix.'posts_topic_id_idx ON '.$db_prefix.'posts(topic_id)';*/
         $queries[] = 'ALTER TABLE '.$db_prefix.'posts ADD INDEX posts_topic_id_idx ( topic_id )';
    /*$queries[] = 'CREATE INDEX '.$db_prefix.'posts_multi_idx ON '.$db_prefix.'posts(poster_id, topic_id)';*/
         $queries[] = 'ALTER TABLE '.$db_prefix.'posts ADD INDEX posts_multi_idx ( poster_id, topic_id )';
    /*$queries[] = 'CREATE INDEX '.$db_prefix.'reports_zapped_idx ON '.$db_prefix.'reports(zapped)';*/
         $queries[] = 'ALTER TABLE '.$db_prefix.'reports ADD INDEX reports_zapped_idx ( zapped )';
    /*$queries[] = 'CREATE INDEX '.$db_prefix.'search_matches_word_id_idx ON '.$db_prefix.'search_matches(word_id)';*/
         $queries[] = 'ALTER TABLE '.$db_prefix.'search_matches ADD INDEX search_matches_word_id_idx ( word_id )';
    /*$queries[] = 'CREATE INDEX '.$db_prefix.'search_matches_post_id_idx ON '.$db_prefix.'search_matches(post_id)';*/
         $queries[] = 'ALTER TABLE '.$db_prefix.'search_matches ADD INDEX search_matches_post_id_idx ( post_id )';
    /*$queries[] = 'CREATE INDEX '.$db_prefix.'topics_forum_id_idx ON '.$db_prefix.'topics(forum_id)';*/
         $queries[] = 'ALTER TABLE '.$db_prefix.'topics ADD INDEX topics_forum_id_idx ( forum_id )';
    /*$queries[] = 'CREATE INDEX '.$db_prefix.'topics_moved_to_idx ON '.$db_prefix.'topics(moved_to)';*/
         $queries[] = 'ALTER TABLE '.$db_prefix.'topics ADD INDEX topics_moved_to_idx ( moved_to )';
    /*$queries[] = 'CREATE INDEX '.$db_prefix.'users_registered_idx ON '.$db_prefix.'users(registered)';*/
         $queries[] = 'ALTER TABLE '.$db_prefix.'users ADD INDEX users_registered_idx ( registered )';

    // Special cases
    switch ($db_type)
    {
        case 'mysql':
        case 'mysqli':
            /*$queries[] = 'CREATE INDEX '.$db_prefix.'search_cache_ident_idx ON '.$db_prefix.'search_cache(ident(8))';*/
                         $queries[] = 'ALTER TABLE '.$db_prefix.'search_cache ADD INDEX search_cache_ident_idx ( ident(8) )';
            /*$queries[] = 'CREATE INDEX '.$db_prefix.'users_username_idx ON '.$db_prefix.'users(username(8))';*/
                         $queries[] = 'ALTER TABLE '.$db_prefix.'users ADD INDEX users_username_idx ( username(8) )';
            break;
 

Re: PunBB 1.2-dev (01 Nov) - Unable to create indexes

I test that when I'm at home.

[img]http://www.famfamfam.com/lab/icons/silk/icons/error.png[/img] /me speaks French and bad English [img]http://www.famfamfam.com/lab/icons/silk/icons/error.png[/img]

Re: PunBB 1.2-dev (01 Nov) - Unable to create indexes

I can confirm this. I will rewrite the commands to use ALTER TABLE ... ADD INDEX instead of CREATE INDEX.

It should be noted that giving someone the ALTER TABLE privilege and then not giving them the CREATE INDEX privilege is very strange. You can do far more damage with ALTER TABLE than with CREATE INDEX. And, as it turns out, you can create indexes anyway with the ALTER TABLE privilege. Odd.

Edit: Of course, PostgreSQL doesn't support ALTER TABLE ... ADD INDEX, so I'll have to do both :(

"Programming is like sex: one mistake and you have to support it for the rest of your life."

31 (edited by Frank H 2004-12-19 14:14)

Re: PunBB 1.2-dev (01 Nov) - Unable to create indexes

ain't it a funny thing to adapt things to work for more than one thing roll big_smile

(loads of things there http://forum.racing.ath.cx/img/smilies/roflol.gif)

32

Re: PunBB 1.2-dev (01 Nov) - Unable to create indexes

The final 1.2 now works. Thx Rickard!