about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20160826155805_add_superapp_to_oauth_applications.rb5
-rw-r--r--db/schema.rb13
-rw-r--r--db/seeds.rb9
3 files changed, 14 insertions, 13 deletions
diff --git a/db/migrate/20160826155805_add_superapp_to_oauth_applications.rb b/db/migrate/20160826155805_add_superapp_to_oauth_applications.rb
new file mode 100644
index 000000000..a1b92fada
--- /dev/null
+++ b/db/migrate/20160826155805_add_superapp_to_oauth_applications.rb
@@ -0,0 +1,5 @@
+class AddSuperappToOauthApplications < ActiveRecord::Migration[5.0]
+  def change
+    add_column :oauth_applications, :superapp, :boolean, default: false, null: false
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 45ab70855..b63df0fea 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 20160325130944) do
+ActiveRecord::Schema.define(version: 20160826155805) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -94,15 +94,16 @@ ActiveRecord::Schema.define(version: 20160325130944) do
   end
 
   create_table "oauth_applications", force: :cascade do |t|
-    t.string   "name",                      null: false
-    t.string   "uid",                       null: false
-    t.string   "secret",                    null: false
-    t.text     "redirect_uri",              null: false
-    t.string   "scopes",       default: "", null: false
+    t.string   "name",                         null: false
+    t.string   "uid",                          null: false
+    t.string   "secret",                       null: false
+    t.text     "redirect_uri",                 null: false
+    t.string   "scopes",       default: "",    null: false
     t.datetime "created_at"
     t.datetime "updated_at"
     t.integer  "owner_id"
     t.string   "owner_type"
+    t.boolean  "superapp",     default: false, null: false
     t.index ["owner_id", "owner_type"], name: "index_oauth_applications_on_owner_id_and_owner_type", using: :btree
     t.index ["uid"], name: "index_oauth_applications_on_uid", unique: true, using: :btree
   end
diff --git a/db/seeds.rb b/db/seeds.rb
index 4edb1e857..c2bf6a16e 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -1,7 +1,2 @@
-# This file should contain all the record creation needed to seed the database with its default values.
-# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
-#
-# Examples:
-#
-#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
-#   Mayor.create(name: 'Emanuel', city: cities.first)
+web_app = Doorkeeper::Application.new(name: 'Web', superapp: true, redirect_uri: Doorkeeper.configuration.native_redirect_uri)
+web_app.save(validate: false)