Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [dwh] How do you create a new def file?

Quote Reply
Re: [dwh] How do you create a new def file? In reply to
You're best bet is to look into GT::SQL::Creator, which will let you make a new .def file, as well as the table. Basic format looks like (taken out of my PPC plugin);

Code:
$creator=$DB->creator('Keywords');
$creator->cols(
Keyword_ID => {
pos => 1,
type => 'INT',
not_null => 1
},
Keyword => {
pos => 2,
type=> 'CHAR',
not_null => 1
},
Num_Searches => {
pos => 3,
type => 'INT',
},
Status => {
pos =>4,
type => 'ENUM',
values => ['Active','Deleted'],
default => 'Active'
}
);
$creator->pk('Keyword_ID');
$creator->ai('Keyword_ID');
$creator->create or $table_errors.= "Unable to create: $GT::SQL::error<br>";

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread How do you create a new def file? dwh 2546 Sep 3, 2004, 5:50 PM
Thread Re: [dwh] How do you create a new def file?
FrankM 2477 Sep 3, 2004, 6:47 PM
Thread Re: [FrankM] How do you create a new def file?
dwh 2478 Sep 3, 2004, 6:57 PM
Post Re: [dwh] How do you create a new def file?
Andy 2473 Sep 4, 2004, 12:34 AM
Post Re: [dwh] How do you create a new def file?
afinlr 2449 Sep 11, 2004, 8:47 AM