Subversion Repositories eFlore/Projets.eflore-projets

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1072 jpm 1
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
2
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
3
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
4
 
5
CREATE SCHEMA IF NOT EXISTS `tb_eflore` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
6
USE `tb_eflore` ;
7
 
8
-- -----------------------------------------------------
9
-- Table `tb_eflore`.`osm_noeuds`
10
-- -----------------------------------------------------
11
DROP TABLE IF EXISTS `tb_eflore`.`osm_noeuds` ;
12
 
13
CREATE  TABLE IF NOT EXISTS `tb_eflore`.`osm_noeuds` (
14
  `id_noeud` BIGINT NOT NULL ,
15
  `lat` DOUBLE NOT NULL ,
16
  `long` DOUBLE NOT NULL ,
17
  PRIMARY KEY (`id_noeud`) )
18
ENGINE = InnoDB;
19
 
20
 
21
-- -----------------------------------------------------
22
-- Table `tb_eflore`.`osm_chemin_a_noeuds`
23
-- -----------------------------------------------------
24
DROP TABLE IF EXISTS `tb_eflore`.`osm_chemin_a_noeuds` ;
25
 
26
CREATE  TABLE IF NOT EXISTS `tb_eflore`.`osm_chemin_a_noeuds` (
27
  `id_chemin` BIGINT NOT NULL ,
28
  `id_noeud` BIGINT NOT NULL ,
29
  `ordre` INT NOT NULL ,
30
  PRIMARY KEY (`id_chemin`, `id_noeud`, `ordre`) ,
31
  INDEX `id_noeud` (`id_noeud` ASC) ,
32
  INDEX `id_chemin` (`id_chemin` ASC) ,
33
  CONSTRAINT `avoir_noeud`
34
    FOREIGN KEY (`id_noeud` )
35
    REFERENCES `tb_eflore`.`osm_noeuds` (`id_noeud` )
36
    ON DELETE NO ACTION
37
    ON UPDATE NO ACTION)
38
ENGINE = InnoDB;
39
 
40
 
41
-- -----------------------------------------------------
42
-- Table `tb_eflore`.`osm_commune`
43
-- -----------------------------------------------------
44
DROP TABLE IF EXISTS `tb_eflore`.`osm_commune` ;
45
 
46
CREATE  TABLE IF NOT EXISTS `tb_eflore`.`osm_commune` (
47
  `id_relation` BIGINT NOT NULL ,
48
  `nom` VARCHAR(255) NULL ,
49
  `code_insee` VARCHAR(5) NULL ,
50
  `polygone` MULTIPOLYGON NULL ,
51
  `centre` POINT NULL ,
52
  `notes` TEXT NULL ,
53
  PRIMARY KEY (`id_relation`) ,
54
  INDEX `code_insee` (`code_insee` ASC) ,
55
  INDEX `commune_polygone` USING BTREE (`polygone` ASC, `centre` ASC) )
56
ENGINE = InnoDB;
57
 
58
 
59
-- -----------------------------------------------------
60
-- Table `tb_eflore`.`osm_relation_a_chemins`
61
-- -----------------------------------------------------
62
DROP TABLE IF EXISTS `tb_eflore`.`osm_relation_a_chemins` ;
63
 
64
CREATE  TABLE IF NOT EXISTS `tb_eflore`.`osm_relation_a_chemins` (
65
  `id_relation` BIGINT NOT NULL ,
66
  `id_chemin` BIGINT NOT NULL ,
67
  `role` VARCHAR(20) NOT NULL ,
68
  `ordre` INT NOT NULL ,
69
  `sens` VARCHAR(15) NOT NULL ,
70
  `nbre_poly` INT NOT NULL ,
71
  PRIMARY KEY (`id_relation`, `id_chemin`) ,
72
  INDEX `role` (`role` ASC) ,
73
  INDEX `sens` (`sens` ASC) ,
74
  INDEX `ordre` (`ordre` ASC) ,
75
  INDEX `nbre_poly` (`nbre_poly` ASC) ,
76
  CONSTRAINT `avoir_chemin_a_noeuds`
77
    FOREIGN KEY ()
78
    REFERENCES `tb_eflore`.`osm_chemin_a_noeuds` ()
79
    ON DELETE NO ACTION
80
    ON UPDATE NO ACTION,
81
  CONSTRAINT `avoir_commune`
82
    FOREIGN KEY ()
83
    REFERENCES `tb_eflore`.`osm_commune` ()
84
    ON DELETE NO ACTION
85
    ON UPDATE NO ACTION)
86
ENGINE = InnoDB;
87
 
88
USE `tb_eflore` ;
89
 
90
 
91
SET SQL_MODE=@OLD_SQL_MODE;
92
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
93
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;