starting migrations

This commit is contained in:
maxwell 2010-12-09 13:41:02 -08:00
parent a4336a8e72
commit 8fe2eb3180
3 changed files with 23 additions and 2 deletions

View file

@ -1,6 +1,6 @@
class Services::Twitter < Service
MAX_CHARACTERS = 140
<D-F>url
def post(post, url='')
Rails.logger.debug("event=post_to_service type=twitter sender_id=#{self.user_id}")
message = public_message(post, url)

View file

@ -5,11 +5,11 @@
require File.join(Rails.root, 'lib/diaspora/user')
require File.join(Rails.root, 'lib/salmon/salmon')
require 'rest-client'
class User
include MongoMapper::Document
include Diaspora::UserModules
include Encryptor::Private
include ActionView::Helpers::TextHelper
plugin MongoMapper::Devise

21
lib/tasks/migration.rb Normal file
View file

@ -0,0 +1,21 @@
namespace :migration do
desc 'make old registered services into the new class specific services'
task :service_reclassify do
Service.all.each do |s|
provider = s.provider
s._type = "Services::#{provider.camelize}"
s.save
end
end
desc 'allow to upgrade old image urls to use rel path'
task :swtich_image_urls do
end
desc 'move all posts and photos to new schema'
task :migrate_status_message_to_posts do
end
end