<< The Adversarial Vice President | Home | Government for the people. Preventing Conflict of Interest >>

Like column

A suggested extension to MySQL

Like column

Create table t1 ( x int unsigned default 911, y like x )

Create table t2 (x like t1.x)

Tricky extension

Create table t2 (x always like t1.x)

Meaning that

alter table t1 modify x int signed

implies a corresponding alter on t2

The purpose of ‘LIKE’ is to avoid multiply specifying that which must always be the same. LIKE both documents the dependency, and eliminates the possibility of inconsistency. ALWAYS LIKE prevents the inconsistency developing in the future.



Add a comment Send a TrackBack