summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/fixtures/development/14_pipelines.rb1
-rw-r--r--db/migrate/20161006104309_add_state_to_environment.rb15
-rw-r--r--db/schema.rb10
3 files changed, 26 insertions, 0 deletions
diff --git a/db/fixtures/development/14_pipelines.rb b/db/fixtures/development/14_pipelines.rb
index 803cbca584d..d3fabe111a1 100644
--- a/db/fixtures/development/14_pipelines.rb
+++ b/db/fixtures/development/14_pipelines.rb
@@ -17,6 +17,7 @@ class Gitlab::Seeder::Pipelines
{ name: 'env:beta', stage: 'deploy', environment: 'beta', status: :running },
{ name: 'env:gamma', stage: 'deploy', environment: 'gamma', status: :canceled },
{ name: 'staging', stage: 'deploy', environment: 'staging', status_event: :success },
+ { name: 'close staging', stage: 'deploy', environment: 'staging', when: 'manual', status: :skipped, options: { environment: { close: true } } },
{ name: 'production', stage: 'deploy', environment: 'production', when: 'manual', status: :skipped },
{ name: 'slack', stage: 'notify', when: 'manual', status: :created },
]
diff --git a/db/migrate/20161006104309_add_state_to_environment.rb b/db/migrate/20161006104309_add_state_to_environment.rb
new file mode 100644
index 00000000000..83dff07069f
--- /dev/null
+++ b/db/migrate/20161006104309_add_state_to_environment.rb
@@ -0,0 +1,15 @@
+class AddStateToEnvironment < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ disable_ddl_transaction!
+
+ DOWNTIME = false
+
+ def up
+ add_column_with_default(:environments, :state, :string, default: :opened)
+ end
+
+ def down
+ remove_column(:environments, :state)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index a362fd8f228..ba2cf686fa9 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -398,12 +398,22 @@ ActiveRecord::Schema.define(version: 20161007133303) do
add_index "emails", ["user_id"], name: "index_emails_on_user_id", using: :btree
create_table "environments", force: :cascade do |t|
+<<<<<<< HEAD
+ t.integer "project_id"
+ t.string "name", null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "external_url"
+ t.string "environment_type"
+ t.string "state", default: "opened", null: false
+=======
t.integer "project_id"
t.string "name", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.string "external_url"
t.string "environment_type"
+>>>>>>> origin/master
end
add_index "environments", ["project_id", "name"], name: "index_environments_on_project_id_and_name", using: :btree