Book Image

Clojure Web Development Essentials

By : Ryan Baldwin
Book Image

Clojure Web Development Essentials

By: Ryan Baldwin

Overview of this book

Table of Contents (19 chapters)
Clojure Web Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating the catalog


At this point, we want to lay the foundation of allowing our user to catalog and view their record collection. We will create a simple Recently Added album page, and a simple Show me all the albums for this artist page (which I'll just call "the artist page"). The first thing to do in order to facilitate this incredible functionality is to create the artists table and the albums table.

Creating the artists table

We will use Migratus to create the artists table. As such, we need to create another SQL migration file. So let's do the following:

  1. In the src/migrations folder, create a new migration script called 00000000000200-artists.up.sql.

  2. For our hipstr app, the artists table is going to be extremely simple. We'll have an artist_id that uniquely identifies the artist, a name (go figure), and two timestamps, created_at and updated_at, for keeping track of when the artist was created and last updated. Add the following SQL:

    CREATE TABLE artists                              ...