From 6fec8afc3f91166930c8b4dfca441a5a70a24d5b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 14 Mar 2016 17:49:13 +0100 Subject: Bind oauth applications to users --- db/migrate/20160314164231_add_owner_to_application.rb | 7 +++++++ db/schema.rb | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20160314164231_add_owner_to_application.rb (limited to 'db') diff --git a/db/migrate/20160314164231_add_owner_to_application.rb b/db/migrate/20160314164231_add_owner_to_application.rb new file mode 100644 index 000000000..7d5e6d07d --- /dev/null +++ b/db/migrate/20160314164231_add_owner_to_application.rb @@ -0,0 +1,7 @@ +class AddOwnerToApplication < ActiveRecord::Migration + def change + add_column :oauth_applications, :owner_id, :integer, null: true + add_column :oauth_applications, :owner_type, :string, null: true + add_index :oauth_applications, [:owner_id, :owner_type] + end +end \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 9710bb965..a5e87024a 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: 20160312193225) do +ActiveRecord::Schema.define(version: 20160314164231) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -107,8 +107,11 @@ ActiveRecord::Schema.define(version: 20160312193225) do t.string "scopes", default: "", null: false t.datetime "created_at" t.datetime "updated_at" + t.integer "owner_id" + t.string "owner_type" end + add_index "oauth_applications", ["owner_id", "owner_type"], name: "index_oauth_applications_on_owner_id_and_owner_type", using: :btree add_index "oauth_applications", ["uid"], name: "index_oauth_applications_on_uid", unique: true, using: :btree create_table "statuses", force: :cascade do |t| -- cgit