Jump to:

3448 Posts in 1062 Topics by 738 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Database/Field name conventions

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 426 Views
  • Ronaldo71
    Community Member
    10 Posts

    Database/Field name conventions Link to this post

    Hi all,

    I have to build a web application on top of an existing and large (mysql) database. Preferably using SilverStripe 3.0.3 or later.
    The design of the database is pretty much ok, but the fieldnames differ slightly from what SilverStripe thinks is best (I agree wit SS though

    - All table names are lowercase ('customer' vs 'Customer')
    - 'ID' fields are lowercase 'id' ('customer.id' vs 'Customer.ID')
    - Foreign key fields use '_id' as postfix, whereas SilverStripe uses 'ID' ('customer_id' vs 'CustomerID').
    - All tables have a kind of prefix ('dbt_asju_'), which I'd rather not use in all my datamodel objects ('dbt_asju_cities' should be the 'City' model).

    Is it possible to set these preferences somewhere? I noted that the datamodel explicitly references the 'ID' field, so my best guess is that it's not possible. Could we change this to a setting that uses the current SilverStripe names as default?

    There is another application that uses the same database, so I cannot afford to rename tables and fields in the database completely. That would also require a rewrite of that other application.


Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.