- or download this
package Person;
use base 'MyCDBI';
...
# PRIMARY KEY (id),
# UNIQUE (name)
# );
- or download this
package Person::Relationship;
use base 'MyCDBI';
...
# child int NOT NULL REFERENCES people,
# PRIMARY KEY (parent,child)
# );
- or download this
Person->has_many(children => [ Person::Relationship => child ]);
Person->has_many(parents => [ Person::Relationship => parent ]);
- or download this
Person->has_many({ self_id => parent }, children => [ Person::Relation
+ship => child ]);
Person->has_many({ self_id => child }, parents => [ Person::Relationsh
+ip => parent ]);