On 2/1/07 3:21 PM, Mike Schilli wrote:
> 1) Two columns of a table form a combined unique key, but neither
>    of them can be defined UNIQUE().

Then you'd just define a unique key using those two columns:

    SQL: UNIQUE(col1, col2),

    RDBO: unique_key => [ 'col1', 'col2' ],

> 2) You have a "unique key" that spans several tables:
> 
>     CREATE TABLE bars (
>       id INTEGER AUTO_INCREMENT PRIMARY KEY NOT NULL,
>       string VARCHAR(255),
>       UNIQUE(string)
>     )Type=InnoDB;
> 
>     CREATE TABLE foos (
>       id INTEGER AUTO_INCREMENT PRIMARY KEY NOT NULL,
>       bar_id INTEGER,
>       UNIQUE(bar_id),
>       FOREIGN KEY(bar_id) REFERENCES bars(id),
>       INDEX(bar_id)
>     )Type=InnoDB;
> 
>     my $foo = Rosetest::Foo->new(bar => { string => "moo!" });
>     $foo->load(speculative => 1); # Error
>     $foo->save();

Multi-table searches are pretty clearly the domain of the Manager, IMO.

> 3) The application isn't at liberty to change the db and must
>    work with a crappy legacy schema.

Yeah, that's always annoying, but also hard to anticipate.  Everyone's
legacy problems are different.

-John



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to