title: How can I write native enum type for a column in rails migration?
body: <p>I have a table named users and I want to add one column with the name status and which will have these enum types ('pending', 'on-going').</p>
  <p>So I tried something like this:</p>
  <pre><code>def up
      execute &lt;&lt;-SQL
        CREATE TYPE statuses AS ENUM ('pending', 'on-going');
        ALTER TABLE users ADD status statuses;
      SQL
    end
  
    def down
      execute &lt;&lt;-SQL
        DROP TYPE statuses;
      SQL
      remove_column :users, :status
    end
  </code></pre>
  <p>But this always leads to this somehow:</p>
  <blockquote>
  <p>Could not dump table &quot;users&quot; because of following StandardError
  Unknown type 'statuses' for column 'status'</p>
  </blockquote>
  <p>What should I do here?</p>