Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki
This commit is contained in:
commit
205fbcb898
|
@ -1,8 +1,9 @@
|
||||||
require 'sqlite3'
|
require 'active_record'
|
||||||
|
|
||||||
task :upgrade_instiki do
|
task :upgrade_instiki => :environment do
|
||||||
db = SQLite3::Database.new( "db/production.db.sqlite3" )
|
ActiveRecord::Base.establish_connection(:production)
|
||||||
db.execute( "select * from webs" ) do |row|
|
webs = ActiveRecord::Base.connection.execute( "select * from webs" )
|
||||||
|
webs.each do |row|
|
||||||
if File.exists?('public/' + row[4])
|
if File.exists?('public/' + row[4])
|
||||||
if File.exists?('webs/' + row[4])
|
if File.exists?('webs/' + row[4])
|
||||||
print "Warning! The directory webs/#{row[4]} already exists. Skipping.\n"
|
print "Warning! The directory webs/#{row[4]} already exists. Skipping.\n"
|
||||||
|
|
Loading…
Reference in a new issue