From f892a00b99c0b754ea4d0750340845c6d9edea97 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 26 Jan 2011 18:39:09 -0800 Subject: [PATCH] Fix data conversion, fixture generation in publicscontroller --- .gitignore | 1 + lib/data_conversion/import_to_mysql.rb | 7 ++- spec/fixtures/hcard.fixture.html | 62 -------------------------- spec/fixtures/host-meta.fixture.html | 9 ---- spec/fixtures/webfinger.fixture.html | 18 -------- 5 files changed, 7 insertions(+), 90 deletions(-) delete mode 100644 spec/fixtures/hcard.fixture.html delete mode 100644 spec/fixtures/host-meta.fixture.html delete mode 100644 spec/fixtures/webfinger.fixture.html diff --git a/.gitignore b/.gitignore index 3c04bc4db..0465c3215 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ public/stylesheets/ui.css public/stylesheets/mobile.css public/diaspora spec/fixtures/*.yml +spec/fixtures/*.fixture.* # Uploded files and local files public/uploads/* diff --git a/lib/data_conversion/import_to_mysql.rb b/lib/data_conversion/import_to_mysql.rb index 8ee83748b..d93a557d4 100644 --- a/lib/data_conversion/import_to_mysql.rb +++ b/lib/data_conversion/import_to_mysql.rb @@ -60,7 +60,12 @@ module DataConversion log "Importing users to main table..." User.connection.execute <<-SQL INSERT INTO users - SELECT mongo_users.* from mongo_users + SELECT mongo_users.*, 'email', mongo_users.email from mongo_users + SQL + User.connection.execute <<-SQL + UPDATE users + SET users.invitation_service = NULL, users.invitation_identifier = NULL + WHERE users.invitation_token IS NULL AND users.mongo_id IS NOT NULL SQL log "Imported #{User.count} users." end diff --git a/spec/fixtures/hcard.fixture.html b/spec/fixtures/hcard.fixture.html deleted file mode 100644 index 46b7bcabc..000000000 --- a/spec/fixtures/hcard.fixture.html +++ /dev/null @@ -1,62 +0,0 @@ -
-

Robert12074e3 Grimm1009eba

-
-
-

User profile

-
-
Nickname
-
-Robert12074e3 Grimm1009eba -
-
-
-
First name
-
-Robert12074e3 -
-
-
-
Family name
-
-Grimm1009eba -
-
-
-
Full name
-
-Robert12074e3 Grimm1009eba -
-
-
-
URL
-
-http://google-1266a2d.com/ -
-
-
-
Photo
-
- -
-
-
-
Photo
-
- -
-
-
-
Photo
-
- -
-
-
-
Searchable
-
-true -
-
-
-
-
diff --git a/spec/fixtures/host-meta.fixture.html b/spec/fixtures/host-meta.fixture.html deleted file mode 100644 index 3b5ca9b2b..000000000 --- a/spec/fixtures/host-meta.fixture.html +++ /dev/null @@ -1,9 +0,0 @@ - - - example.org - - Resource Descriptor - - diff --git a/spec/fixtures/webfinger.fixture.html b/spec/fixtures/webfinger.fixture.html deleted file mode 100644 index 0a9224bc1..000000000 --- a/spec/fixtures/webfinger.fixture.html +++ /dev/null @@ -1,18 +0,0 @@ - - - acct:alice@example.org - "http://google-1266a2d.com/" - - - - - - - -