From 53a8ad91fabdf757d3f1fc204fb2e498fa0f3450 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Fri, 6 Jun 2014 16:16:38 -0400 Subject: [PATCH] Fix for symbol locs. --- bitshift/crawler/crawl.py | 4 ++-- bitshift/database/migration.py | 9 ++++++++- bitshift/database/schema.sql | 10 +++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/bitshift/crawler/crawl.py b/bitshift/crawler/crawl.py index 045ee11..cd8fba6 100644 --- a/bitshift/crawler/crawl.py +++ b/bitshift/crawler/crawl.py @@ -37,10 +37,10 @@ def crawl(): crawler.BitbucketCrawler(repo_clone_queue, run_event), indexer.GitIndexer(repo_clone_queue, run_event)] - for thread in threads: - thread.start() parse_servers = start_parse_servers() time.sleep(5) + for thread in threads: + thread.start() try: while 1: diff --git a/bitshift/database/migration.py b/bitshift/database/migration.py index b3eabbd..730790f 100644 --- a/bitshift/database/migration.py +++ b/bitshift/database/migration.py @@ -3,7 +3,7 @@ Contains information about database schema versions, and SQL queries to update between them. """ -VERSION = 9 +VERSION = 10 MIGRATIONS = [ # 1 -> 2 @@ -115,6 +115,13 @@ MIGRATIONS = [ ALTER TABLE `symbol_locations` AUTO_INCREMENT = 1; END// DELIMITER ;""" + ], + # 9 -> 10 + [ + """ALTER TABLE `symbol_locations` + MODIFY COLUMN `sloc_col` INT UNSIGNED DEFAULT NULL, + MODIFY COLUMN `sloc_end_row` INT UNSIGNED DEFAULT NULL, + MODIFY COLUMN `sloc_end_col` INT UNSIGNED DEFAULT NULL""" ] ] diff --git a/bitshift/database/schema.sql b/bitshift/database/schema.sql index 3c4a75e..6102fe8 100644 --- a/bitshift/database/schema.sql +++ b/bitshift/database/schema.sql @@ -1,4 +1,4 @@ --- Schema version 9 +-- Schema version 10 CREATE DATABASE `bitshift` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; USE `bitshift`; @@ -6,7 +6,7 @@ USE `bitshift`; CREATE TABLE `version` ( `version` INT UNSIGNED NOT NULL ) ENGINE=InnoDB; -INSERT INTO `version` VALUES (9); +INSERT INTO `version` VALUES (10); CREATE TABLE `origins` ( `origin_id` TINYINT UNSIGNED NOT NULL AUTO_INCREMENT, @@ -77,9 +77,9 @@ CREATE TABLE `symbol_locations` ( `sloc_symbol` BIGINT UNSIGNED NOT NULL, `sloc_type` TINYINT UNSIGNED NOT NULL, `sloc_row` INT UNSIGNED NOT NULL, - `sloc_col` INT UNSIGNED NOT NULL, - `sloc_end_row` INT UNSIGNED NOT NULL, - `sloc_end_col` INT UNSIGNED NOT NULL, + `sloc_col` INT UNSIGNED DEFAULT NULL, + `sloc_end_row` INT UNSIGNED DEFAULT NULL, + `sloc_end_col` INT UNSIGNED DEFAULT NULL, PRIMARY KEY (`sloc_id`), FOREIGN KEY (`sloc_symbol`) REFERENCES `symbols` (`symbol_id`)