Skip to content

Commit

Permalink
Saving fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianAker committed Feb 27, 2003
1 parent 1dd9ac7 commit b2af3a4
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions plugins/Zoo/rebuildPeople
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,6 @@ createEnvironment($opts{u});
$slashdb = getCurrentDB();
$constants = getCurrentStatic();

# First clean up fans/freaks
$slashdb->sqlDo("UPDATE people SET perceive=NULL");
$slashdb->sqlDo("DELETE FROM people WHERE type IS NULL");

# Put in blanks
$slashdb->sqlDo("CREATE TEMPORARY TABLE people_select SELECT person,uid FROM people WHERE type IS NOT NULL");
$slashdb->sqlDo("INSERT IGNORE INTO people (uid,person) SELECT * from people_select");
$slashdb->sqlDo("DROP TABLE people_select");

# Put back fans
$slashdb->sqlDo(qq|SELECT CONCAT("UPDATE people SET perceive='fan' WHERE uid =", person, " AND person =", uid, ";") INTO OUTFILE '/tmp/rebuildpeople-fan.sql' FROM people WHERE type='friend'|);
$slashdb->sqlDo("source /tmp/rebuildpeople-fan.sql");

# Put back freaks
$slashdb->sqlDo(qq|SELECT CONCAT("UPDATE people SET perceive='freak' WHERE uid =", person, " AND person =", uid, ";") INTO OUTFILE '/tmp/rebuildpeople-freak.sql' FROM people WHERE type='foe'|);
$slashdb->sqlDo("source /tmp/rebuildpeople-freak.sql");

#
my $people = $slashdb->sqlSelectColArrayref('DISTINCT uid', 'people');
Expand Down

0 comments on commit b2af3a4

Please sign in to comment.