about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-03-14 17:49:13 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-03-14 17:49:13 +0100
commit6fec8afc3f91166930c8b4dfca441a5a70a24d5b (patch)
tree4cd02810b87de1dccf7b96630910921d76357921 /db
parent25d7c1b6eaf03ddaec892c82f7d93a128b79a872 (diff)
Bind oauth applications to users
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20160314164231_add_owner_to_application.rb7
-rw-r--r--db/schema.rb5
2 files changed, 11 insertions, 1 deletions
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|