If I'd like to have a table with three columns:
firstname
,lastname
andusername
(a combination offirstname
andlastname
)
I'd like the table to auto generate the username as soon as a record is inserted with a first & lastname.
Please note that I would like it to do so in an automated fashion, without the use of a cronjob or something as such.
How can I set this up efficiently? From what I understand MySQL does not support declarative computed fields.
According to this page: MySQL 5.0 Reference Manual :: 18 Stored Programs and Views :: 18.3 Using Triggers
MySQL triggers activate only for changes made to tables by SQL statements. They do not activate for changes in tables made by APIs that do not transmit SQL statements to the MySQL Server; in particular, they are not activated by updates made using the NDB API
I am using version 5.0.95 which should support triggers. Do you think Magento's ORM will be compatible with this?