diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-05-31 21:15:40 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-05-31 21:15:40 +0000 |
commit | eb728d37a7ed940d9d9b1f762c4ea65cc8e35a56 (patch) | |
tree | be6524aa6298385e9bcb93789989bd225b65b043 /db | |
parent | 161af17c1b69e7e00aefcd4f540a55755259ceda (diff) | |
parent | 3fc4b2c86090841d9a6245b9b73e46231610703e (diff) | |
download | gitlab-ce-eb728d37a7ed940d9d9b1f762c4ea65cc8e35a56.tar.gz |
Merge branch 'master' into 'trigger-source'
# Conflicts:
# db/schema.rb
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20170525174156_create_feature_tables.rb | 26 | ||||
-rw-r--r-- | db/schema.rb | 22 |
2 files changed, 46 insertions, 2 deletions
diff --git a/db/migrate/20170525174156_create_feature_tables.rb b/db/migrate/20170525174156_create_feature_tables.rb new file mode 100644 index 00000000000..a083c89c85f --- /dev/null +++ b/db/migrate/20170525174156_create_feature_tables.rb @@ -0,0 +1,26 @@ +class CreateFeatureTables < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def self.up + create_table :features do |t| + t.string :key, null: false + t.timestamps null: false + end + add_index :features, :key, unique: true + + create_table :feature_gates do |t| + t.string :feature_key, null: false + t.string :key, null: false + t.string :value + t.timestamps null: false + end + add_index :feature_gates, [:feature_key, :key, :value], unique: true + end + + def self.down + drop_table :feature_gates + drop_table :features + end +end diff --git a/db/schema.rb b/db/schema.rb index 7371ce8847f..bac8f95ce3b 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: 20170524125940) do +ActiveRecord::Schema.define(version: 20170525174156) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -441,6 +441,24 @@ ActiveRecord::Schema.define(version: 20170524125940) do add_index "events", ["target_id"], name: "index_events_on_target_id", using: :btree add_index "events", ["target_type"], name: "index_events_on_target_type", using: :btree + create_table "feature_gates", force: :cascade do |t| + t.string "feature_key", null: false + t.string "key", null: false + t.string "value" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "feature_gates", ["feature_key", "key", "value"], name: "index_feature_gates_on_feature_key_and_key_and_value", unique: true, using: :btree + + create_table "features", force: :cascade do |t| + t.string "key", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "features", ["key"], name: "index_features_on_key", unique: true, using: :btree + create_table "forked_project_links", force: :cascade do |t| t.integer "forked_to_project_id", null: false t.integer "forked_from_project_id", null: false @@ -1474,4 +1492,4 @@ ActiveRecord::Schema.define(version: 20170524125940) do add_foreign_key "trending_projects", "projects", on_delete: :cascade add_foreign_key "u2f_registrations", "users" add_foreign_key "web_hook_logs", "web_hooks", on_delete: :cascade -end +end
\ No newline at end of file |