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

Rename access token to instances

parent 7098c3a8
......@@ -1954,12 +1954,12 @@ ActiveRecord::Schema.define(version: 20180926140319) do
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_access_tokens", force: :cascade do |t|
create_table "operations_feature_flags_instances", force: :cascade do |t|
t.integer "project_id", null: false
t.string "token", null: false
end
add_index "operations_feature_flags_access_tokens", ["project_id", "token"], name: "project_feature_flag_access_token", unique: true, using: :btree
add_index "operations_feature_flags_instances", ["token"], name: "index_operations_feature_flags_instances_on_token", unique: true, using: :btree
create_table "packages_maven_metadata", id: :bigserial, force: :cascade do |t|
t.integer "package_id", limit: 8, null: false
......@@ -3252,7 +3252,7 @@ ActiveRecord::Schema.define(version: 20180926140319) do
add_foreign_key "notification_settings", "users", name: "fk_0c95e91db7", on_delete: :cascade
add_foreign_key "oauth_openid_requests", "oauth_access_grants", column: "access_grant_id", name: "fk_oauth_openid_requests_oauth_access_grants_access_grant_id"
add_foreign_key "operations_feature_flags", "projects", on_delete: :cascade
add_foreign_key "operations_feature_flags_access_tokens", "projects", on_delete: :cascade
add_foreign_key "operations_feature_flags_instances", "projects", on_delete: :cascade
add_foreign_key "packages_maven_metadata", "packages_packages", column: "package_id", name: "fk_be88aed360", on_delete: :cascade
add_foreign_key "packages_package_files", "packages_packages", column: "package_id", name: "fk_86f0f182f8", on_delete: :cascade
add_foreign_key "packages_packages", "projects", on_delete: :cascade
......
......@@ -4,7 +4,7 @@ class AddFeatureFlagsToProjects < ActiveRecord::Migration
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
def change
def up
create_table :operations_feature_flags do |t|
t.integer :project_id, null: false
t.datetime_with_timezone :created_at, null: false
......@@ -19,13 +19,18 @@ class AddFeatureFlagsToProjects < ActiveRecord::Migration
t.index [:project_id, :name], unique: true
end
create_table :operations_feature_flags_access_tokens do |t|
create_table :operations_feature_flags_instances do |t|
t.integer :project_id, null: false
t.string :token, null: false
t.index [:project_id, :token], unique: true, name: :project_feature_flag_access_token
t.index :token, unique: true
t.foreign_key :projects, column: :project_id, on_delete: :cascade
end
end
def down
drop_table :operations_feature_flags
drop_table :operations_feature_flags_instances
end
end
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