atlantagasil.blogg.se

Sql code formatter
Sql code formatter











  • Type fields should be a foreign key reference to another table (not a column that is basically an enumeration).
  • sql code formatter

  • ID is your primary key column (typically).
  • Tables should have an updated_at column if rows are ever updated.
  • Tables should have a created_at column (NOT NULL DEFAULT now()) if the table is every added to.
  • Use VERB_at for timestamps (created_at, updated_at, logged_in_at).
  • Use TRUE and FALSE not ‘t’ and ‘f’ for Boolean values.
  • Use adjectives for Boolean columns (use visible, not is_visible or visible_p).
  • Don’t use SQL keywords as column names (from, limit, order).
  • Name your tables plural nouns (users, profiles, and posts).
  • Identifiers (names of tables and columns) should be all lower case with words separated by underscores.
  • sql code formatter

    Again, they have been used over many years, work for my teams and me but I consider most of them less important than some order of consistency. Most of these are just one dude’s opinion (J1D0). I won’t be covering schema normalization and naming conventions (I’ll write other blog posts on those subjects), but let me summarize some basic best practices on this here because you will be seeing the conventions in the examples.













    Sql code formatter