Remove not null constraint on project_id in services.

This commit is contained in:
Marin Jankovski 2015-02-11 09:47:21 -08:00
parent 5515366064
commit 09d3d351a1
3 changed files with 9 additions and 4 deletions

View file

@ -5,12 +5,12 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
# project_id :integer not null
# project_id :integer
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
# properties :text
# tempalate :boolean default(FALSE)
# template :boolean default(FALSE)
# To add new service you should build a class inherited from Service
# and implement a set of methods

View file

@ -0,0 +1,5 @@
class AllowNullInServicesProjectId < ActiveRecord::Migration
def change
change_column :services, :project_id, :integer, null: true
end
end

View file

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20150211172122) do
ActiveRecord::Schema.define(version: 20150211174341) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -360,7 +360,7 @@ ActiveRecord::Schema.define(version: 20150211172122) do
create_table "services", force: true do |t|
t.string "type"
t.string "title"
t.integer "project_id", null: false
t.integer "project_id"
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "active", default: false, null: false