Data Modeling

Now that we have a database that properly supports our desired features, let’s create a data model that supports the commonalities and that can be extended to support all of them.

As we discussed in Account Management, account management impacts many parts of our app and should be tackled first. We have a users table, which will be referenced by posts and by other users in multiple ways. Let’s think about which columns are essential and which columns we might add later.

We definitely need login and password columns, and we want a created_at column for auditing and metadata.

In the future, we’ll probably want to add a bunch of user data, such as username, avatar, last login, and so on, but we’ll address those later.

Let’s create ...

Get Web Development with Clojure, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.