title: Why isn't this column being added in psql?
body: <p>I'm following this book and on p.219 I run into an issue where I get an error that the &quot;profile&quot; column isn't being added.</p>
  <p><a href="https://pragprog.com/titles/dswdcloj3/web-development-with-clojure-third-edition/" rel="nofollow noreferrer">https://pragprog.com/titles/dswdcloj3/web-development-with-clojure-third-edition/</a></p>
  <p>I'm trying to just run it with the source-code (the guestbook-profile files), and I can't get it to work so I don't know what I'm doing wrong.</p>
  <p>I do the following command:</p>
  <pre><code>(get-user* {:login &quot;testuser&quot;})
  </code></pre>
  <p>and get the error:</p>
  <pre><code>Execution error (PSQLException) at org.postgresql.core.v3.QueryExecutorImpl/receiveErrorResponse (QueryExecutorImpl.java:2553).
  ERROR: column &quot;profile&quot; does not exist
    Position: 27
  </code></pre>
  <p>I looked at the guestbook database, and the user table, and it's true that there is no profile column. But there are files in resources&gt;migrations that add a profile column:</p>
  <pre><code>ALTER TABLE users
    ADD COLUMN profile JSONB DEFAULT '{}'::JSONB;
  </code></pre>
  <p>and in the sql queries file it has code for the profiles:</p>
  <pre><code>-- START:profile
  -- :name set-profile-for-user*  :&lt;! :1
  -- :doc sets a profile map for the specified user
  UPDATE users
  SET profile = :profile
  where :login = login
  RETURNING *;
  
  -- :name get-user* :? :1
  -- :doc gets a user's publicly available information
  SELECT login, created_at, profile from users
  WHERE login = :login
  -- END:profile
  </code></pre>
  <p>Please tell me what other information to share. Why isn't the profile column being added? How do I fix this?</p>
  <p>EDIT: I just typed the following into a psql command line:</p>
  <pre><code>ALTER TABLE users
    ADD COLUMN profile JSONB DEFAULT '{}'::JSONB;
  </code></pre>
  <p>And now things seem to be working ok. Is this normal to just have to use the command line? Or is it more typical to just have the commands in the resources folder? If so, why didn't mine work? Thanks</p>