CREATE TABLE PRODUCTS(
ID INTEGER,
NAME VARCHAR2(255 BYTE) NOT NULL,
STATUS VARCHAR2(128 BYTE) DEFAULT 'inactive' NOT NULL,
DATE_CREATED TIMESTAMP(6) DEFAULT sysdate,
RELEASE_DATE TIMESTAMP(6),
VENDOR_ID INTEGER
);
When calling perl_class_defintion from within my Rose::DB::Object class as such :
__PACKAGE__->meta->table('PRODUCTS');
__PACKAGE__->meta->auto_initialize();
print __PACKAGE__->meta->perl_class_definition(
indent => 4,
braces => 'bsd'
);
It returns all scalar column types :
package TestApp::DB::Object::Product;
use strict;
use base qw(TestApp::DB::Object);
__PACKAGE__->meta->setup
(
table => 'PRODUCTS',
columns =>
[
ID => { type => 'scalar', alias => 'id', length => 38, not_null => 1 },
NAME => { type => 'scalar', alias => 'name', length => 255, not_null => 1 },
STATUS => { type => 'scalar', alias => 'status', default => 'inactive', length => 128, not_null => 1 },
DATE_CREATED => { type => 'scalar', alias => 'date_created', default => 'sysdate', length => 11 },
RELEASE_DATE => { type => 'scalar', alias => 'release_date', length => 11 },
VENDOR_ID => { type => 'scalar', alias => 'vendor_id', length => 38 },
],
primary_key_columns => [ 'ID' ],
);
1;
Also, it doesn't seem to be detecting unique indices as well. I have a unique index defined on the 'name' column but as you can see 'unique_key => name' isn't part of the output.
I've scoured the docs (as well as this group) for the answer but to no avail.
Thoughts?
Thanks.