One of my DBIx::Class table classes has:
__PACKAGE__->table("adjacents");
__PACKAGE__->add_columns(
"child_id" => { ... },
"parent_id" => { ... },
);
__PACKAGE__->set_primary_key("child_id");
__PACKAGE__->base_has_one(parent_string => 'X::Schema::String',
{'foreign.object_id' => 'self.parent_id'});
This results in the (MySQL) creation commands
CREATE TABLE `adjacents` (
...
CONSTRAINT `fk_parent_id` FOREIGN KEY (`parent_id`)
REFERENCES `strings` (`object_id`)
The problem is I want to eliminate this constraint from the
SQL creation but not from what DBIx accessors are made.
(Because the constraint is sometimes violated, and I need to
index it in a special way).
How do I create a relationship so I can call
$object->parent_string, but not have a CONSTRAINT added to
the database schema?
Thanks
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]