Kaynağa Gözat

Fix for symbol locs.

tags/v1.0^2
Ben Kurtovic 10 yıl önce
ebeveyn
işleme
53a8ad91fa
3 değiştirilmiş dosya ile 15 ekleme ve 7 silme
  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 Dosyayı Görüntüle

@@ -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:


+ 8
- 1
bitshift/database/migration.py Dosyayı Görüntüle

@@ -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"""
]
]



+ 5
- 4
bitshift/database/schema.sql Dosyayı Görüntüle

@@ -1,4 +1,4 @@
-- 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`)


Yükleniyor…
İptal
Kaydet