Repository navigation
Expand file tree
/
Copy pathTreeOfSavior.sql
More file actions
62 lines (55 loc) · 2.17 KB
/
Copy pathTreeOfSavior.sql
File metadata and controls
62 lines (55 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
-- MySQL Script generated by MySQL Workbench
-- 05/15/17 15:35:15
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema mydb
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Table `locations`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `locations` (
`id` INT NOT NULL AUTO_INCREMENT,
`location_id` INT NULL,
`name` VARCHAR(255) NULL,
`recommended_level` INT NULL,
`type` ENUM('hunting_ground', 'instanced_dungeon', 'town', 'field') NULL,
`has_zemyna_statue` TINYINT(1) NULL,
`position` JSON NULL,
`territory` ENUM('klaipeda', 'orsha', 'fedimian') NULL,
`created` DATETIME NULL,
`modified` DATETIME NULL,
PRIMARY KEY (`id`),
INDEX `fk_locations_locations_idx` (`location_id` ASC),
CONSTRAINT `fk_locations_locations`
FOREIGN KEY (`location_id`)
REFERENCES `locations` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `locations_locations`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `locations_locations` (
`location_id` INT NOT NULL,
`location_parent_id` INT NOT NULL,
INDEX `fk_locations_has_locations_locations2_idx` (`location_parent_id` ASC),
INDEX `fk_locations_has_locations_locations1_idx` (`location_id` ASC),
PRIMARY KEY (`location_id`, `location_parent_id`),
CONSTRAINT `fk_locations_has_locations_locations1`
FOREIGN KEY (`location_id`)
REFERENCES `locations` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_locations_has_locations_locations2`
FOREIGN KEY (`location_parent_id`)
REFERENCES `locations` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;