Skip to content

Commit

Permalink
Added notes on column names
Browse files Browse the repository at this point in the history
  • Loading branch information
mpscholten committed Jul 23, 2021
1 parent ffa5d8d commit d55aab3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Guide/naming-conventions.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,27 @@ Posts -- Should be lowercase `posts`
company -- Should be `companies`
```

### Column Names

Column names should always use lowercase and snake case.

Column names are typically folded to lowercase by postgres. Therefore camel case names like `firstName` will be stored as `firstname` in the schema. It's better to name this column `first_name`.

Here are some examples of good column names:

```sql
email
is_paid
user_id
created_at
```

Here are some examples of bad column names:
```sql
isConfirmed -- Not in snake case, should be `is_confirmed`
firstName -- Not in snake case, should be `first_name`
```

## View

**Module Names:**
Expand Down

0 comments on commit d55aab3

Please sign in to comment.