From ad8e5973fab0b6de395c5af3d11d4b4b510a9715 Mon Sep 17 00:00:00 2001 From: Urban Rotnik Date: Thu, 28 Feb 2019 10:44:37 +0100 Subject: [PATCH] Remove not null constraint from project_id in Activity table --- ...01_remove_null_constraint_from_project_in_activities.rb | 7 +++++++ db/schema.rb | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20190227110801_remove_null_constraint_from_project_in_activities.rb diff --git a/db/migrate/20190227110801_remove_null_constraint_from_project_in_activities.rb b/db/migrate/20190227110801_remove_null_constraint_from_project_in_activities.rb new file mode 100644 index 000000000..b14b042f1 --- /dev/null +++ b/db/migrate/20190227110801_remove_null_constraint_from_project_in_activities.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class RemoveNullConstraintFromProjectInActivities < ActiveRecord::Migration[5.1] + def change + change_column_null :activities, :project_id, :integer, true + end +end diff --git a/db/schema.rb b/db/schema.rb index f897df04c..390a26461 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20190213064847) do +ActiveRecord::Schema.define(version: 20190227110801) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -25,7 +25,7 @@ ActiveRecord::Schema.define(version: 20190213064847) do t.string "message" t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.bigint "project_id", null: false + t.bigint "project_id" t.bigint "experiment_id" t.string "subject_type" t.bigint "subject_id"