DNNCommunity / Dnn.StructuredContent

This is a proof of concept for a structured content solution for DNN Platform (formerly known as DotNetNuke). This should not be used in a production environment. Anything can change at this stage of development.
Other
13 stars 5 forks source link

Database Schema Discussion for `ID` #65

Closed WillStrohl closed 2 years ago

WillStrohl commented 2 years ago

I've noticed that the ID columns are literally named 'ID`. This issue is here to discuss if we want to change that before this module has an official release to prevent potential issues in the future since this is a reserved word.

WillStrohl commented 2 years ago

@david-poindexter @valadas FYI...

valadas commented 2 years ago

Can you define what you mean by Id being a reserved word?

I always use Id because then you can have a base class for your entities and do generic stuff that works with any entity

WillStrohl commented 2 years ago

D'oh! Never mind. Got my SQL crossed. ID is okay. :)

https://docs.microsoft.com/en-us/sql/t-sql/language-elements/reserved-keywords-transact-sql?view=sql-server-ver15

WillStrohl commented 2 years ago

However, a more specific ID naming convention is often better/easier and less error-prone when more complex queries are needed to be made.

donker commented 2 years ago

Yep. My pattern follows the rest of DNN where we use WidgetId to reference the ID of a Widget. I agree we should attempt to ensure we make a good start with this module.