From 2936abbc91c01d9e4fa5e77c41d6b4910f5c8152 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Wed, 24 Apr 2013 19:10:45 -0400 Subject: [PATCH] Update semester field type to enum --- .../20130424230817_change_alerts_semester_type.rb | 13 +++++++++++++ db/schema.rb | 14 +++----------- 2 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 db/migrate/20130424230817_change_alerts_semester_type.rb diff --git a/db/migrate/20130424230817_change_alerts_semester_type.rb b/db/migrate/20130424230817_change_alerts_semester_type.rb new file mode 100644 index 0000000..82d6098 --- /dev/null +++ b/db/migrate/20130424230817_change_alerts_semester_type.rb @@ -0,0 +1,13 @@ +class ChangeAlertsSemesterType < ActiveRecord::Migration + def up + change_table :alerts do |t| + t.change :semester, :enum + end + end + + def down + change_table :alerts do |t| + t.change :semester, :string + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 41b8f56..381e886 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,18 +11,10 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130413054153) do +ActiveRecord::Schema.define(:version => 20130424230817) do - create_table "alerts", :force => true do |t| - t.integer "user_id" - t.string "department" - t.string "course" - t.boolean "alerted", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "semester" - t.text "sections" - end +# Could not dump table "alerts" because of following StandardError +# Unknown type 'enum' for column 'semester' create_table "roles", :force => true do |t| t.string "name"