In simple terms, I was able to create a simple field using the perl script, then edit the fields using the tools GT already has (I don't know why they don't have tools already create tables, drop, etc that mess with def files too)...
Anyway, here is the script I used...
use lib 'admin path';
use Links qw/$IN $CFG $DB/;
Links::init('admin path'); local $SIG{__DIE__} = \&Links::fatal;
main(); sub main {
#---------------------------------------------------
# my ($table_name, $creator); $table_name = "Tricks"; $creator = $DB->creator($table_name); # create a dummy column
$creator->cols(
TrickID => {
pos => 1,
type => 'INT',
size => '10',
not_null => 1,
default => 0
}
); # set the primary key $creator->pk('TrickID'); # will not work if table exists $creator->create(); print $IN->header();
print qq|<a href="$CFG->{admin_root_url}/admin.cgi?do=editor_columns&db=$table_name">Go to Editor</a>|;
}
I could have covered errors etc, but I decided just to post the simple code for anyone's reference...
- Jonathan
Anyway, here is the script I used...
Code:
#!/usr/bin/perl #================================ use strict; use lib 'admin path';
use Links qw/$IN $CFG $DB/;
Links::init('admin path'); local $SIG{__DIE__} = \&Links::fatal;
main(); sub main {
#---------------------------------------------------
# my ($table_name, $creator); $table_name = "Tricks"; $creator = $DB->creator($table_name); # create a dummy column
$creator->cols(
TrickID => {
pos => 1,
type => 'INT',
size => '10',
not_null => 1,
default => 0
}
); # set the primary key $creator->pk('TrickID'); # will not work if table exists $creator->create(); print $IN->header();
print qq|<a href="$CFG->{admin_root_url}/admin.cgi?do=editor_columns&db=$table_name">Go to Editor</a>|;
}
I could have covered errors etc, but I decided just to post the simple code for anyone's reference...
- Jonathan