Forum

Results 1 to 11 of 11
  1. #1
    Join Date
    December 2003
    Location
    Brazil
    Posts
    35

    [Sugestion] Mysql tables name PREFIX

    In TeamSpeak2 all tables have a ts2_ prefix, in TeamSpeak3 the tables doenst have prefix.

    For MySQL and users that have more than one aplication using only one Database is more clean and organized when you use tables with prefix.

    Please add a ts3_ prefix on SQL Scheme.


    Ok i made the changes manualy, here is the SQL filex (create_tables, defaults and the others sql files) with ts3_ prefix added

    First this work only with a new fresh ts3 installation

    Here the codes
    http://reiserfs.killermonkeys.net/sc..._prefix.tar.gz

    If you wanna change your actual database, go to phpmyadmin and rename the tables and put the new sql files on your ts3 folder.

    I made the sql files using a small shell script

    Code:
    for z in `ls`; do cat $z | sed -e 's/into /into ts3_/g' > temp;cat temp>$z;done
    for z in `ls`; do cat $z | sed -e 's/INTO /INTO ts3_/g' > temp;cat temp>$z;done
    for z in `ls`; do cat $z | sed -e 's/update /update ts3_/g' > temp;cat temp>$z;done
    for z in `ls`; do cat $z | sed -e 's/from /from ts3_/g' > temp;cat temp>$z;done
    Last edited by ReiserFS; December 22nd, 2009 at 05:52 PM.

  2. #2
    Join Date
    October 2006
    Location
    San Antonio, TexASS | USA
    Posts
    85
    WOW


    +1

    Agreed!

  3. #3
    Join Date
    January 2006
    Location
    Australia
    Posts
    27
    +1 support for that. Make it a config option in the mysql ini file.

  4. #4
    Join Date
    November 2009
    Location
    No
    Posts
    37
    agreed, adding a 'TS3_' prefix to the table names would be great.

  5. #5
    Join Date
    December 2003
    Location
    Brazil
    Posts
    35
    Ok i made the changes manualy, here is the SQL filex (create_tables, defaults and the others sql files) with ts3_ prefix added

    First this work only with a new fresh ts3 installation

    Here the codes
    http://reiserfs.killermonkeys.net/sc..._prefix.tar.gz

    If you wanna change your actual database, go to phpmyadmin and rename the tables and put the new sql files on your ts3 folder.

    I made the sql files using a small shell script

    Code:
    for z in `ls`; do cat $z | sed -e 's/into /into ts3_/g' > temp;cat temp>$z;done
    for z in `ls`; do cat $z | sed -e 's/INTO /INTO ts3_/g' > temp;cat temp>$z;done
    for z in `ls`; do cat $z | sed -e 's/update /update ts3_/g' > temp;cat temp>$z;done
    for z in `ls`; do cat $z | sed -e 's/from /from ts3_/g' > temp;cat temp>$z;done

  6. #6
    Join Date
    December 2003
    Location
    Brazil
    Posts
    35
    Meh doenst use this script yet, the server work nice for the first time, bug wont recongnize if the tables already exist and will not start again.

  7. #7
    Join Date
    December 2003
    Location
    Brazil
    Posts
    35
    Ok i kind of solve the problem.


    When the server start he search for the tables WITHOUT the prefix on the DATABASE. If the server doenst find the table he will execute create_tables.sql again.

    So to make the prefix tables work, you have to create the tables without prefix too, just to start the server. (The server will use the tables with PREFIX you set up with the sql files).

    i know this is sux, but works, i hope they put the prefix suport soon.

  8. #8
    Join Date
    December 2004
    Location
    RF
    Posts
    3,007
    Try adding "IF NOT EXISTS" clause to create_tables.sql.
    Or does your server not recognize existing install at all?

  9. #9
    Join Date
    December 2003
    Location
    Brazil
    Posts
    35
    Tyried that, but i have to remove the INDEXES too or put a big sql to check if the indexes exist.

    Some like this

    if not exists (select * from sysindexes
    where id=object_id('<table_name>') and name='<index_name>')
    create index <index_name> on <table_name>(<field_names>)

    I will make a new sql with this later and post here if work, but i have a BIG hope that BETA3 will introduce a prefix table for us.

  10. #10
    Join Date
    March 2009
    Location
    Germany
    Posts
    74
    http://forum.teamspeak.com/showthread.php?p=241579

    around three month later and nothing changed. I guess the table names are hardcoded into libts3db_mysql.so - could you please release the source of that file so we can fix that little thing within some hours or are you going to fix it yourself?

    Thanks!
    Last edited by R. Ludwig; June 11th, 2010 at 11:41 AM. Reason: removed some big words

  11. #11
    Join Date
    May 2006
    Location
    Europe/Czech Rep.
    Posts
    1,616

    table prefix

    imho, it was one of good featues that ts2 came up with at a times. (like having all sql querys in files for customization)

    It might not be such a deal to put there a prefixes, just another variable next to the current one/static_text, depends on *.sql contents.


    Maybe when we are at it, why dont we ask devs, to put that problematic part in checkTablesCreated.sql ? The test will then just check if that sql statement returns 0 rows or 23 rows?

    anyway big question: that check is done only at startup, so, how often does any of proper ts3server installation restarts?


    Statement: this feature is nice to have.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Resolved] Unable to use mysql data base... unable to create tables
    By 3dhomejoe in forum Windows
    Replies: 4
    Last Post: October 3rd, 2011, 05:28 PM
  2. [Suggest] More Tables and informations for TS3 over MYSQL
    By mainfield in forum Suggestions and Feedback
    Replies: 3
    Last Post: February 24th, 2010, 02:22 AM
  3. MYSQL Database Structure and tables like TS2
    By Jing in forum Linux / FreeBSD
    Replies: 5
    Last Post: January 12th, 2010, 03:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •