Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Adding new tables bsw defs updates?

Quote Reply
Adding new tables bsw defs updates?
Hello ALL:

What is the best procedure in adding new tables and having the defs activated?

Please help. I'm creating/adding tables manuelly but defs does not exits.

Thank you, pcurran
Quote Reply
Re: [pyc] Adding new tables bsw defs updates? In reply to
Hi pyc,

This is the script I user to create or update table def files:

Code:
#!/usr/bin/perl -w

use strict;
use lib '/path/to/GT/lib'; # Use the path to GT modules here
use GT::SQL;

$| = 1;

my $db = new GT::SQL '/path/to/private/data/admin/defs';
my $table = 'prefix_table-name';

my $creator = $db->creator ($table);
$creator->load_table();

print "$table.def has been updated/created.\n";

I made a couple of quick changes above that I haven't tested but it should do the trick for you.

~Charlie
Quote Reply
Re: [Chaz] Adding new tables bsw defs updates? In reply to
I should note that this script is run from a shell and not a browser!

~Charlie
Quote Reply
Re: [Chaz] Adding new tables bsw defs updates? In reply to
Hello Chaz:
I`m having problem with the table creation. Here is the code and error after execution:

#!/opt/perl5/bin/perl -w
use strict;
use lib '/opt/gt/gt-bin/admin';
use GT::SQL;

$| = 1;

my $db = new GT::SQL '/opt/gt/data/admin/defs';
my $table = 'webdb_images';

my $creator = $db->creator($table);
$creator->load_table();

print "$table.def has been updated/created.\n";


After executing, here is the error (./create_table_gt.pl):
~
~
DBD::mysql::st execute failed: Table 'webdb.webdb_images' doesn't exist at /opt/gt/gt-bin/admin/GT/SQL/Driver/MYSQL.pm line 117.

Please give some cludes. Thank you, peter
Quote Reply
Re: [pyc] Adding new tables bsw defs updates? In reply to
Are you sure that the table you are trying to create the def for (webdb_images) is in the same database as the GMail tables? It looks like it can't find the table.

~Charlie
Quote Reply
Re: [Chaz] Adding new tables bsw defs updates? In reply to
Aha, you mean I should first create the table? I will try creating the table first and will inform you.
Thank you, pcurran
Quote Reply
Re: [pyc] Adding new tables bsw defs updates? In reply to
Hi,

Also ensure that webdb_images has the prefix that u have set for the tables during setup. If it was webmail_ then the webdb_omages will be webmail_webdb_images otherwise u'll get the same error again.

Thnx

Anup
Quote Reply
Re: [anup123] Adding new tables bsw defs updates? In reply to
Hello Anup et all:

I have just started having the problem you mentioned above.
My table has the name "webdb_images". It already has the prefix "webdb_". How should the Setup(SQLServer's setup) come to play here?

In the Setup's Field "Table Prefix:", I included "webdb_" and checked the Option "Load table info from an existing set of tables(or resync the def files if you have changed your defs manually)."

I can display the tables for editing but can`t display the "users signup" page.
It gives the Error: " GT::SQL (1088): File '/opt/gt/data/admin/defs/webdb_webdb_images.def' does not exist".

Ofcourse my def file in this case is webdb_images; not webdb_webdb_images.

Do you know what is happing? You seems to be mentioning it.
Thank you, pcurran
Quote Reply
Re: [pyc] Adding new tables bsw defs updates? In reply to
Hi Peter,

JIC the example could help u understand. I created a table webmail_hosting_users (the table prefix in my case is webmail) in my test install database with database name say database.

Then i had run the following:

#!/usr/bin/perl -w
use lib '/path/to/admin';
use strict;
# Use the path to GT modules here
use GT::SQL; $| = 1;
my $db = new GT::SQL '/path/to/...../data/admin/defs';
my $table = 'hosting_users';
my $creator = $db->creator ($table); $creator->load_table();
print "$table.def has been updated/created.\n";

./scriptname

And it just ran without any probs. things marked in red need to be paid attn to. Substitute the values in above with your own and give it a try.

Run this from shell.

Thnx

Anup
Quote Reply
Re: [anup123] Adding new tables bsw defs updates? In reply to
Thanks Gents:
Everything is coming on fine.
pcurran