Merge pull request #2465 from betagouv/finish-feedback-migration
Finish feedback migration
This commit is contained in:
commit
625f3696f1
4 changed files with 14 additions and 3 deletions
|
@ -6,4 +6,6 @@ class Feedback < ApplicationRecord
|
|||
neutral: 'neutral',
|
||||
unhappy: 'unhappy'
|
||||
}
|
||||
|
||||
validates :rating, presence: true
|
||||
end
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class MakeFeedbacksRatingNotNull < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
change_column_null :feedbacks, :rating, false
|
||||
end
|
||||
end
|
5
db/migrate/20180827111451_remove_mark_on_feedbacks.rb
Normal file
5
db/migrate/20180827111451_remove_mark_on_feedbacks.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class RemoveMarkOnFeedbacks < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
remove_column :feedbacks, :mark
|
||||
end
|
||||
end
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2018_08_27_102828) do
|
||||
ActiveRecord::Schema.define(version: 2018_08_27_111451) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
@ -320,10 +320,9 @@ ActiveRecord::Schema.define(version: 2018_08_27_102828) do
|
|||
|
||||
create_table "feedbacks", force: :cascade do |t|
|
||||
t.bigint "user_id"
|
||||
t.integer "mark"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "rating"
|
||||
t.string "rating", null: false
|
||||
t.index ["user_id"], name: "index_feedbacks_on_user_id"
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue