Commit ec383872 authored by Kamil Trzciński's avatar Kamil Trzciński

Optimise Feature Flags DB schema

parent 25907d0f
......@@ -1943,18 +1943,18 @@ ActiveRecord::Schema.define(version: 20180926140319) do
t.string "nonce", null: false
end
create_table "operations_feature_flags", force: :cascade do |t|
create_table "operations_feature_flags", id: :bigserial, force: :cascade do |t|
t.integer "project_id", null: false
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
t.boolean "active", null: false
t.string "name", null: false
t.text "description"
t.boolean "active", null: false
end
add_index "operations_feature_flags", ["project_id", "name"], name: "index_operations_feature_flags_on_project_id_and_name", unique: true, using: :btree
create_table "operations_feature_flags_clients", force: :cascade do |t|
create_table "operations_feature_flags_clients", id: :bigserial, force: :cascade do |t|
t.integer "project_id", null: false
t.string "token", null: false
end
......
......@@ -5,21 +5,21 @@ class AddFeatureFlagsToProjects < ActiveRecord::Migration
DOWNTIME = false
def change
create_table :operations_feature_flags do |t|
create_table :operations_feature_flags, id: :bigserial do |t|
t.integer :project_id, null: false
t.datetime_with_timezone :created_at, null: false
t.datetime_with_timezone :updated_at, null: false
t.boolean :active, null: false
t.string :name, null: false
t.text :description
t.boolean :active, null: false
t.foreign_key :projects, column: :project_id, on_delete: :cascade
t.index [:project_id, :name], unique: true
end
create_table :operations_feature_flags_clients do |t|
create_table :operations_feature_flags_clients, id: :bigserial do |t|
t.integer :project_id, null: false
t.string :token, null: false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment