Commit 114022c3 authored by cividesk's avatar cividesk

Added first_commit to github_users

parent 6e4fde56
......@@ -559,6 +559,7 @@ CREATE TABLE IF NOT EXISTS `github_user` (
`email` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`location` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`avatar_url` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`first_commit` DATETIME,
PRIMARY KEY (`login`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
......
......@@ -91,4 +91,14 @@ foreach ($dbh->query($query) as $row) {
echo "Unknown user - login: " . $row[0] . "\n";
}
}
$query = "
UPDATE github_user
SET first_commit = (
SELECT MIN(author_date)
FROM github_commit
WHERE author_login = login
)
WHERE first_commit IS NULL;
";
$dbh->query($query);
echo " $updated updates, $skipped in error." . PHP_EOL;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment