Hello
I've following (test) setup, in a MySQL 5.0.17 database:
create table vendors (
vendor_id integer primary key auto_increment,
vendor_name varchar(100)
);
create table products (
product_id integer primary key auto_increment,
name varchar(100),
vendor_id integer not null,
foreign key vendor_id_fk(vendor_id) references vendor(vendor_id)
);
then in file t/Product.pm:
package t::Product;
use strict;
use t::DBConn;
use base 'Rose::DB::Object';
sub init_db { return t::DBConn->new; }
__PACKAGE__->meta->auto_initialize;
print __PACKAGE__->meta->perl_class_definition(indent => 2, braces => 'bsd');
However, executing 'perl -I. t/Product.pm' gives this output:
-------------------------------
package t::Product;
use strict;
use base qw(Rose::DB::Object);
__PACKAGE__->meta->setup
(
table => 'products',
columns =>
[
product_id => { type => 'integer', not_null => 1 },
name => { type => 'varchar', length => 100 },
vendor_id => { type => 'integer', default => '', not_null => 1 },
],
primary_key_columns => [ 'product_id' ],
);
1;
-----------------------
Why didn't it detect Foreign Key definition as promised in the tutorial?
- Praveen
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object