Browse Source

Fix for symbol locs.

tags/v1.0^2
Ben Kurtovic 10 years ago
parent
commit
53a8ad91fa
3 changed files with 15 additions and 7 deletions
  1. +2
    -2
      bitshift/crawler/crawl.py
  2. +8
    -1
      bitshift/database/migration.py
  3. +5
    -4
      bitshift/database/schema.sql

+ 2
- 2
bitshift/crawler/crawl.py View File

@@ -37,10 +37,10 @@ def crawl():
crawler.BitbucketCrawler(repo_clone_queue, run_event), crawler.BitbucketCrawler(repo_clone_queue, run_event),
indexer.GitIndexer(repo_clone_queue, run_event)] indexer.GitIndexer(repo_clone_queue, run_event)]


for thread in threads:
thread.start()
parse_servers = start_parse_servers() parse_servers = start_parse_servers()
time.sleep(5) time.sleep(5)
for thread in threads:
thread.start()


try: try:
while 1: while 1:


+ 8
- 1
bitshift/database/migration.py View File

@@ -3,7 +3,7 @@ Contains information about database schema versions, and SQL queries to update
between them. between them.
""" """


VERSION = 9
VERSION = 10


MIGRATIONS = [ MIGRATIONS = [
# 1 -> 2 # 1 -> 2
@@ -115,6 +115,13 @@ MIGRATIONS = [
ALTER TABLE `symbol_locations` AUTO_INCREMENT = 1; ALTER TABLE `symbol_locations` AUTO_INCREMENT = 1;
END// END//
DELIMITER ;""" 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"""
] ]
] ]




+ 5
- 4
bitshift/database/schema.sql View File

@@ -1,4 +1,4 @@
-- Schema version 10


CREATE DATABASE `bitshift` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; CREATE DATABASE `bitshift` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE `bitshift`; USE `bitshift`;
@@ -6,7 +6,7 @@ USE `bitshift`;
CREATE TABLE `version` ( CREATE TABLE `version` (
`version` INT UNSIGNED NOT NULL `version` INT UNSIGNED NOT NULL
) ENGINE=InnoDB; ) ENGINE=InnoDB;
INSERT INTO `version` VALUES (9);
INSERT INTO `version` VALUES (10);


CREATE TABLE `origins` ( CREATE TABLE `origins` (
`origin_id` TINYINT UNSIGNED NOT NULL AUTO_INCREMENT, `origin_id` TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -77,9 +77,9 @@ CREATE TABLE `symbol_locations` (
`sloc_symbol` BIGINT UNSIGNED NOT NULL, `sloc_symbol` BIGINT UNSIGNED NOT NULL,
`sloc_type` TINYINT UNSIGNED NOT NULL, `sloc_type` TINYINT UNSIGNED NOT NULL,
`sloc_row` INT 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`), PRIMARY KEY (`sloc_id`),
FOREIGN KEY (`sloc_symbol`) FOREIGN KEY (`sloc_symbol`)
REFERENCES `symbols` (`symbol_id`) REFERENCES `symbols` (`symbol_id`)


Loading…
Cancel
Save