Skip to content

Database 'x_' prefixes

Kosudo edited this page Oct 15, 2012 · 2 revisions

We want to allow people to create their own fields which will be stored in the database, and ultimately perhaps, their own tables. Where they do, we have to ensure that such fields and tables do not conflict with future versions of nextSIS.

For example, let's say we don't have a boolean lunch field that indicates whether a student or teacher has lunch at school, so a user creates it as 'lunch' (we want to give them the ability to give it a recognisable name). However, if this field is called 'lunch' in the 'person' table, and later we add the field to nextSIS, we have a conflict. So, we avoid this by automatically prefixing 'x_' (which is a notional shorthand meaning 'eXtended') to the user-created field or table name. So the user's new field is now 'x_lunch'.

We will never use the 'x_' prefix in nextSIS, but we reserve the right at this point to use anything else. So, in a future version we might include our own lunch field, this is installed into the table and our user is left with 'lunch' and 'x_lunch', so there is no conflict.

Of course, this isn't always going to be perfect for the user, but they can simply exclude our 'lunch' field from their display and keep using their own.

Clone this wiki locally