Skip to content

Commit

Permalink
split into separate migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Apr 7, 2015
1 parent 2dad943 commit 31afbb4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,5 @@ def up
if panopticon
SupportedPermission.create!(application: panopticon, name: "keywords")
end

publisher = ::Doorkeeper::Application.find_by_name("publisher")
if publisher
SupportedPermission.create!(application: publisher, name: "keywords")
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CreateKeywordsPermissionForPublisher < ActiveRecord::Migration
class SupportedPermission < ActiveRecord::Base
belongs_to :application, class_name: 'Doorkeeper::Application'
end

def up
publisher = ::Doorkeeper::Application.find_by_name("publisher")
if publisher
SupportedPermission.create!(application: publisher, name: "keywords")
end
end
end
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20140220150716) do
ActiveRecord::Schema.define(:version => 20150407103219) do

create_table "batch_invitation_users", :force => true do |t|
t.integer "batch_invitation_id"
Expand Down

0 comments on commit 31afbb4

Please sign in to comment.