about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <v.ambo@me.com>2012-03-12T08·47+0100
committerVincent Ambo <v.ambo@me.com>2012-03-12T08·47+0100
commitc6124d9aa71f1a6241e4d3d816e80dee49b4cc6b (patch)
treee03e40345f780f1618dd174d0f134e82f2152c02
parent6d9144a7ee6030f1c46320a0bc3a3d37982d171f (diff)
* changes to migration script. As expected it doesn't work yet
-rw-r--r--tools/acid-migrate/Acid.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/acid-migrate/Acid.hs b/tools/acid-migrate/Acid.hs
index ab81cdceeb63..e4b00a6cae9b 100644
--- a/tools/acid-migrate/Acid.hs
+++ b/tools/acid-migrate/Acid.hs
@@ -30,7 +30,7 @@ import qualified Data.Text  as Text
 
 {-CouchDB imports-}
 
-import Database.CouchDB
+import Database.CouchDB hiding (runCouchDB')
 import Database.CouchDB.JSON
 import Text.JSON
 import Data.List (intersperse)
@@ -187,6 +187,10 @@ $(makeAcidic ''Blog
 	])
 
 -- CouchDB database functions
+
+runCouchDB' :: CouchMonad a -> IO a
+runCouchDB' = runCouchDB "hackbox.local" 5984
+
 instance JSON Comment where
 	showJSON = undefined
 	readJSON val = do
@@ -207,7 +211,7 @@ instance JSON Entry where
 		year <- jsonField "year" obj
 		stext <- jsonField "text" obj
 		comments <- jsonField "comments" obj
-		oldid <- jsonField "id_" obj
+		oldid <- jsonField "_id" obj
 		let leTime = parseShittyTime year month day oldid
 		return $ Entry (EntryId $ getUnixTime leTime) DE (pack sauthor) (pack stitle) (pack stext) (Text.empty) 
 						leTime [] comments
@@ -255,4 +259,5 @@ main = do
 convertEntries acid = do
 	entries <- parseOldEntries
 	let x = map (pasteToDB acid) entries
-	putStrLn "Conversion successful"
+	let titles = map (title) entries
+	putStrLn $ show titles