Can you provide more details, so we could reproduce the problem? It works for me with sqlite:
This is being done against MySQL and here is an abbreviated version of the schema I'm using:
$ cat ../sql-src/schema.sql
drop table if exists density;
create table density (
density_id integer not null auto_increment primary key,
density varchar(25) not null
);
drop table if exists startype;
create table startype (
startype_id integer not null auto_increment primary key,
startype varchar(10) not null
);
drop table if exists starsize;
create table starsize (
starsize_id integer not null auto_increment primary key,
starsize varchar(10) not null
);
drop table if exists sector;
create table sector (
sector_id integer not null auto_increment primary key,
name varchar(80) not null
);
drop table if exists subsector;
create table subsector (
subsector_id integer not null auto_increment primary key,
name varchar(80) not null default 'unnamed',
location char not null default 'A',
startx integer not null default 1,
starty integer not null default 1,
endx integer not null default 8,
endy integer not null default 10,
density integer not null
references density(density_id),
sector integer not null
references sector(sector_id)
);
The relationship should be sector->has_many_subsector and subsector belongs_to sector. Here is a sanitized version of the config file for dbicdump:
$ cat schema.conf
schema_class RPG::Traveller::DB::Schema
use_moose 1
<naming>
relationships v6
monikers v6
column_accessors v6
force_ascii 1
</naming>
<connect_info>
dsn dbi:mysql:host=mydatabasehost.mydomain.com;database=st
+armapper
user AUSER
pass APASSWORD
</connect_info>
and by the way use_moose doesn't seem to be doing anything. If I run dbicdump against that config file I see:
$ dbicdump schema.conf
Dumping manual schema for RPG::Traveller::DB::Schema to directory . ..
+.
Schema dump completed.
and the grep shows:
<code>
$ grep -RE "belongs_to|has_many" .
$
Any pointers would be appreciated.
Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Outside of code tags, you may need to use entities for some characters:
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|