title: Rails: creating a custom data type / creating a shorthand
body: <p>I am wondering how I could create a custom data type to use within the rake migration file. Example: if you would be creating a model, inside the migration file you can add columns. It could look like this:</p>
  
  <pre><code>  def self.up
      create_table :products do |t|
        t.column :name, :string
        t.timestamps
      end
    end
  </code></pre>
  
  <p>I would like to know how to create something like this:</p>
  
  <pre><code>t.column :name, :my_custom_data_type
  </code></pre>
  
  <p>The reason for this to create for example a "currency" type, which is nothing more than a decimal with a precision of 8 and a scale of 2. Since I use only MySQL, the solution for this database is sufficient enough.</p>
  
  <p>Thank you for your feedback and comments!</p>