summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-15 13:00:13 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-06-15 13:00:13 +0200
commit14433b341d5e8f0e55d984b478267f5df98f42ae (patch)
tree7aeb7fbe6924066240f0e6abdee54772967d3ddf /db
parenteb26755d63dbe3b4c32230a2ec8730a0d889f292 (diff)
downloadgitlab-ce-14433b341d5e8f0e55d984b478267f5df98f42ae.tar.gz
Make `project_id` and `environment_id` nullableenvironments-and-deployments
This is done to make belongs_to with required to properly validate association. Otherwise `ActiveRecord::StatementInvalid` is raised.
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20160610204157_add_deployments.rb4
-rw-r--r--db/schema.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/db/migrate/20160610204157_add_deployments.rb b/db/migrate/20160610204157_add_deployments.rb
index cfa842daa6d..a15f6c0ea6b 100644
--- a/db/migrate/20160610204157_add_deployments.rb
+++ b/db/migrate/20160610204157_add_deployments.rb
@@ -7,8 +7,8 @@ class AddDeployments < ActiveRecord::Migration
def change
create_table :deployments, force: true do |t|
t.integer :iid, null: false
- t.integer :project_id, null: false
- t.integer :environment_id, null: false
+ t.integer :project_id
+ t.integer :environment_id
t.string :ref, null: false
t.boolean :tag, null: false
t.string :sha, null: false
diff --git a/db/schema.rb b/db/schema.rb
index 3ac64e888ee..1e8d86d0aae 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -385,8 +385,8 @@ ActiveRecord::Schema.define(version: 20160610301627) do
create_table "deployments", force: :cascade do |t|
t.integer "iid", null: false
- t.integer "project_id", null: false
- t.integer "environment_id", null: false
+ t.integer "project_id"
+ t.integer "environment_id"
t.string "ref", null: false
t.boolean "tag", null: false
t.string "sha", null: false
@@ -413,7 +413,7 @@ ActiveRecord::Schema.define(version: 20160610301627) do
add_index "emails", ["user_id"], name: "index_emails_on_user_id", using: :btree
create_table "environments", force: :cascade do |t|
- t.integer "project_id", null: false
+ t.integer "project_id"
t.string "name", null: false
t.datetime "created_at"
t.datetime "updated_at"