Skip to content

Instantly share code, notes, and snippets.

@Fernan2
Last active January 17, 2017 19:23
Show Gist options
  • Select an option

  • Save Fernan2/6ba272b5fb571956969b260b17febe02 to your computer and use it in GitHub Desktop.

Select an option

Save Fernan2/6ba272b5fb571956969b260b17febe02 to your computer and use it in GitHub Desktop.
Enumerados en Rails y Postgres
class CreateFinalidadPrestamo < ActiveRecord::Migration
def up
execute <<-SQL
CREATE TYPE finalidad_prestamo AS
ENUM ('Reunificar deudas', 'Estudios', 'Imprevistos', 'Compra de vehículo', 'Viaje', 'Reformas hogar', 'Otros');
SQL
end
def down
execute <<-SQL
DROP TYPE finalidad_prestamo;
SQL
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment