|
@@ -1,4 +1,4 @@ |
|
|
|
|
|
-- Schema version 4 |
|
|
|
|
|
|
|
|
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 (3); |
|
|
|
|
|
|
|
|
INSERT INTO `version` VALUES (4); |
|
|
|
|
|
|
|
|
CREATE TABLE `origins` ( |
|
|
CREATE TABLE `origins` ( |
|
|
`origin_id` TINYINT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
|
`origin_id` TINYINT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
@@ -65,10 +65,6 @@ CREATE TABLE `symbols` ( |
|
|
`symbol_code` BIGINT NOT NULL, |
|
|
`symbol_code` BIGINT NOT NULL, |
|
|
`symbol_type` TINYINT UNSIGNED NOT NULL, |
|
|
`symbol_type` TINYINT UNSIGNED NOT NULL, |
|
|
`symbol_name` VARCHAR(512) NOT NULL, |
|
|
`symbol_name` VARCHAR(512) NOT NULL, |
|
|
`symbol_row` INT UNSIGNED NOT NULL, |
|
|
|
|
|
`symbol_col` INT UNSIGNED NOT NULL, |
|
|
|
|
|
`symbol_end_row` INT UNSIGNED NOT NULL, |
|
|
|
|
|
`symbol_end_col` INT UNSIGNED NOT NULL, |
|
|
|
|
|
PRIMARY KEY (`symbol_id`), |
|
|
PRIMARY KEY (`symbol_id`), |
|
|
KEY (`symbol_type`, `symbol_name`(32)), |
|
|
KEY (`symbol_type`, `symbol_name`(32)), |
|
|
FOREIGN KEY (`symbol_code`) |
|
|
FOREIGN KEY (`symbol_code`) |
|
@@ -76,6 +72,20 @@ CREATE TABLE `symbols` ( |
|
|
ON DELETE CASCADE ON UPDATE CASCADE |
|
|
ON DELETE CASCADE ON UPDATE CASCADE |
|
|
) ENGINE=InnoDB; |
|
|
) ENGINE=InnoDB; |
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE `symbol_locations` ( |
|
|
|
|
|
`sloc_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
|
|
|
|
`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, |
|
|
|
|
|
PRIMARY KEY (`sloc_id`), |
|
|
|
|
|
FOREIGN KEY (`sloc_symbol`) |
|
|
|
|
|
REFERENCES `symbols` (`symbol_id`) |
|
|
|
|
|
ON DELETE CASCADE ON UPDATE CASCADE |
|
|
|
|
|
) ENGINE=InnoDB; |
|
|
|
|
|
|
|
|
CREATE TABLE `cache` ( |
|
|
CREATE TABLE `cache` ( |
|
|
`cache_id` INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
|
`cache_id` INT UNSIGNED NOT NULL AUTO_INCREMENT, |
|
|
`cache_hash` BIGINT NOT NULL, |
|
|
`cache_hash` BIGINT NOT NULL, |
|
|