Jump to content

Granite WMS/Standards/Database

From Wikibooks, open books for an open world

Granite database naming convention

This document will outline our naming convention. We can like or dislike some of the wording but that’s neither the point nor the benefit. Having one is important and necessary. Take note the existing standard granite does not fully adhere to the standard I need to still refactor some names of views. Also use best English word possible and don’t use abbreviations if you can help it.

Tables

One word with the exception of custom tables. Call the table the best word as close to the business lingo possible, not technical lingo. Custom tables start with Custom_.

Views, Store procedures

Prefix is used to point out technically the used by.

  • Views for reports start with Report_.
  • Views used internally by Granite application App_
  • Views shared between views used in granite internally Base_App_
  • Views for 3d party ERP_
  • Views for integration Integration_
  • Views shared by report and internal Granite Report_App_
  • Views ending with _View is for views representing a table (only MasterItemAlias_View). It means theres a table with same name.
  • Custom views start with Custom_
  • Stored Procedures: If it's a store proc for an external application, use the best name of that application. (Example: MailNotification_XXX_XXX). Same for views used by external applications.
  • Views/Stored Procs used in and by other Views and StoredProcs. My stored procedure is called Prescript_Move_Location, in the script I'm using a view to help me get a job number, that view should be called Prescript_Move_Location_JobNumber.

After the prefix use following guidelines.

  • Module in application (business lingo)
  • Followed by section name (business lingo)
  • Examples
  • [Prefix]_[Module]_[Section]
  • App_Inventory_StockTake

Columns Names

  • Use camel case for more than one word
    • Example: FirstSecondThird
  • Don’t use spaces