diff options
author | Ali Ibrahim <aliibrahim@gmail.com> | 2016-08-14 13:49:08 -0400 |
---|---|---|
committer | Ali Ibrahim <aliibrahim@gmail.com> | 2016-08-17 11:11:08 -0400 |
commit | 2b73aaa15ad9f651f51f8c71de461da6664a4fbb (patch) | |
tree | 0704849e63b0d396ab367056348c1eb90646b884 /db | |
parent | d1da2e8180d92e5f4a8b5ebb36b0f4e4d0618bf8 (diff) | |
download | gitlab-ce-2b73aaa15ad9f651f51f8c71de461da6664a4fbb.tar.gz |
Allow to add deploy keys with write-access
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20160811172945_add_can_push_to_keys.rb | 27 | ||||
-rw-r--r-- | db/schema.rb | 21 |
2 files changed, 38 insertions, 10 deletions
diff --git a/db/migrate/20160811172945_add_can_push_to_keys.rb b/db/migrate/20160811172945_add_can_push_to_keys.rb new file mode 100644 index 00000000000..de7d07ccabb --- /dev/null +++ b/db/migrate/20160811172945_add_can_push_to_keys.rb @@ -0,0 +1,27 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddCanPushToKeys < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + # When a migration requires downtime you **must** uncomment the following + # constant and define a short and easy to understand explanation as to why the + # migration requires downtime. + # DOWNTIME_REASON = '' + + # When using the methods "add_concurrent_index" or "add_column_with_default" + # you must disable the use of transactions as these methods can not run in an + # existing transaction. When using "add_concurrent_index" make sure that this + # method is the _only_ method called in the migration, any other changes + # should go in a separate migration. This ensures that upon failure _only_ the + # index creation fails and can be retried or reverted easily. + # + disable_ddl_transaction! + + def change + add_column_with_default(:keys, :can_push, :boolean, default: false, allow_null: false) + end +end diff --git a/db/schema.rb b/db/schema.rb index 445f484a8c7..d8c6922fb1d 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: 20160810142633) do +ActiveRecord::Schema.define(version: 20160811172945) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -484,6 +484,7 @@ ActiveRecord::Schema.define(version: 20160810142633) do t.string "type" t.string "fingerprint" t.boolean "public", default: false, null: false + t.boolean "can_push", default: false, null: false end add_index "keys", ["fingerprint"], name: "index_keys_on_fingerprint", unique: true, using: :btree @@ -589,12 +590,12 @@ ActiveRecord::Schema.define(version: 20160810142633) do t.datetime "locked_at" t.integer "updated_by_id" t.string "merge_error" + t.text "merge_params" t.boolean "merge_when_build_succeeds", default: false, null: false t.integer "merge_user_id" t.string "merge_commit_sha" t.datetime "deleted_at" t.string "in_progress_merge_commit_sha" - t.text "merge_params" end add_index "merge_requests", ["assignee_id"], name: "index_merge_requests_on_assignee_id", using: :btree @@ -930,8 +931,8 @@ ActiveRecord::Schema.define(version: 20160810142633) do t.string "noteable_type" t.string "title" t.text "description" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "submitted_as_ham", default: false, null: false end @@ -1001,13 +1002,13 @@ ActiveRecord::Schema.define(version: 20160810142633) do add_index "u2f_registrations", ["user_id"], name: "index_u2f_registrations_on_user_id", using: :btree create_table "user_agent_details", force: :cascade do |t| - t.string "user_agent", null: false - t.string "ip_address", null: false - t.integer "subject_id", null: false - t.string "subject_type", null: false + t.string "user_agent", null: false + t.string "ip_address", null: false + t.integer "subject_id", null: false + t.string "subject_type", null: false t.boolean "submitted", default: false, null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "users", force: :cascade do |t| |