Browse Source

Updated doc/tables.*

Dmitry Yu Okunev 6 years ago
parent
commit
f109497015
3 changed files with 80 additions and 71 deletions
  1. 1 0
      .gitignore
  2. BIN
      doc/tables.mwb
  3. 79 71
      doc/tables.sql

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+doc/tables.mwb.bak

BIN
doc/tables.mwb


+ 79 - 71
doc/tables.sql

@@ -1,5 +1,5 @@
 -- MySQL Script generated by MySQL Workbench
+-- Fri 27 Mar 2015 03:45:01 PM MSK
 -- Model: New Model    Version: 1.0
 -- MySQL Workbench Forward Engineering
 
@@ -8,67 +8,67 @@ SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
 
 -- -----------------------------------------------------
+-- Table `agreement_procedures_names`
 -- -----------------------------------------------------
-DROP TABLE IF EXISTS `agreementProceduresNames` ;
+DROP TABLE IF EXISTS `agreement_procedures_names` ;
 
-CREATE TABLE IF NOT EXISTS `agreementProceduresNames` (
-  `agreementProcedure_id` INT NOT NULL AUTO_INCREMENT,
-  `agreementProcedure_name` VARCHAR(255) NULL,
-  PRIMARY KEY (`agreementProcedure_id`))
+CREATE TABLE IF NOT EXISTS `agreement_procedures_names` (
+  `agreement_procedure_id` INT NOT NULL AUTO_INCREMENT,
+  `agreement_procedure_name` VARCHAR(255) NULL,
+  PRIMARY KEY (`agreement_procedure_id`))
 ENGINE = InnoDB
 DEFAULT CHARACTER SET = utf8
 COLLATE = utf8_general_ci;
 
 
 -- -----------------------------------------------------
+-- Table `agreement_lists_names`
 -- -----------------------------------------------------
-DROP TABLE IF EXISTS `agreementListsNames` ;
+DROP TABLE IF EXISTS `agreement_lists_names` ;
 
-CREATE TABLE IF NOT EXISTS `agreementListsNames` (
-  `agreementList_id` INT NOT NULL AUTO_INCREMENT,
-  `agreementList_name` VARCHAR(255) NULL,
-  PRIMARY KEY (`agreementList_id`))
+CREATE TABLE IF NOT EXISTS `agreement_lists_names` (
+  `agreement_list_id` INT NOT NULL AUTO_INCREMENT,
+  `agreement_list_name` VARCHAR(255) NULL,
+  PRIMARY KEY (`agreement_list_id`))
 ENGINE = InnoDB
 DEFAULT CHARACTER SET = utf8
 COLLATE = utf8_general_ci;
 
 
 -- -----------------------------------------------------
+-- Table `agreement_signatures_types`
 -- -----------------------------------------------------
-DROP TABLE IF EXISTS `agreementSignaturesTypes` ;
+DROP TABLE IF EXISTS `agreement_signatures_types` ;
 
-CREATE TABLE IF NOT EXISTS `agreementSignaturesTypes` (
-  `agreementSignatureType_id` INT NOT NULL AUTO_INCREMENT,
-  `agreementSignatureType_name` VARCHAR(45) NOT NULL,
-  `agreementSignatureType_registeredName` VARCHAR(45) NOT NULL,
-  PRIMARY KEY (`agreementSignatureType_id`))
+CREATE TABLE IF NOT EXISTS `agreement_signatures_types` (
+  `agreement_signature_type_id` INT NOT NULL AUTO_INCREMENT,
+  `agreement_signature_type_name` VARCHAR(45) NOT NULL,
+  `agreement_signature_type_registered_name` VARCHAR(45) NOT NULL,
+  PRIMARY KEY (`agreement_signature_type_id`))
 ENGINE = InnoDB
 DEFAULT CHARACTER SET = utf8
 COLLATE = utf8_general_ci;
 
 
 -- -----------------------------------------------------
+-- Table `agreement_lists`
 -- -----------------------------------------------------
-DROP TABLE IF EXISTS `agreementLists` ;
+DROP TABLE IF EXISTS `agreement_lists` ;
 
-CREATE TABLE IF NOT EXISTS `agreementLists` (
-  `agreementList_id` INT NOT NULL AUTO_INCREMENT,
+CREATE TABLE IF NOT EXISTS `agreement_lists` (
+  `agreement_list_id` INT NOT NULL AUTO_INCREMENT,
   `user_id` INT NULL,
-  `agreementSignatureType_id` INT NULL DEFAULT 0,
-  PRIMARY KEY (`agreementList_id`),
-  INDEX `fk_agreementSignatureType_id_idx` (`agreementSignatureType_id` ASC),
-  CONSTRAINT `fk_agreementList_id`
-    FOREIGN KEY (`agreementList_id`)
-    REFERENCES `agreementListsNames` (`agreementList_id`)
+  `agreement_signature_type_id` INT NULL DEFAULT 0,
+  PRIMARY KEY (`agreement_list_id`),
+  INDEX `fk_agreementSignatureType_id_idx` (`agreement_signature_type_id` ASC),
+  CONSTRAINT `fk_agreementList_id2name`
+    FOREIGN KEY (`agreement_list_id`)
+    REFERENCES `agreement_lists_names` (`agreement_list_id`)
     ON DELETE CASCADE
     ON UPDATE CASCADE,
-  CONSTRAINT `fk_agreementSignatureType_id`
-    FOREIGN KEY (`agreementSignatureType_id`)
-    REFERENCES `agreementSignaturesTypes` (`agreementSignatureType_id`)
+  CONSTRAINT `fk_agreementSignatureType_id_potential`
+    FOREIGN KEY (`agreement_signature_type_id`)
+    REFERENCES `agreement_signatures_types` (`agreement_signature_type_id`)
     ON DELETE CASCADE
     ON UPDATE CASCADE)
 ENGINE = InnoDB
@@ -77,25 +77,25 @@ COLLATE = utf8_general_ci;
 
 
 -- -----------------------------------------------------
+-- Table `agreement_procedures`
 -- -----------------------------------------------------
-DROP TABLE IF EXISTS `agreementProcedures` ;
+DROP TABLE IF EXISTS `agreement_procedures` ;
 
-CREATE TABLE IF NOT EXISTS `agreementProcedures` (
-  `agreementProcedure_id` INT NOT NULL AUTO_INCREMENT,
-  `agreementStep` INT NOT NULL,
-  `agreementList_id` INT NULL,
-  PRIMARY KEY (`agreementProcedure_id`, `agreementStep`),
-  INDEX `agreementProcedure_id` (`agreementProcedure_id` ASC),
-  INDEX `fk_agreementList_id_idx` (`agreementList_id` ASC),
-  CONSTRAINT `fk_agreementProcedure_id`
-    FOREIGN KEY (`agreementProcedure_id`)
-    REFERENCES `agreementProceduresNames` (`agreementProcedure_id`)
+CREATE TABLE IF NOT EXISTS `agreement_procedures` (
+  `agreement_procedure_id` INT NOT NULL AUTO_INCREMENT,
+  `agreement_ptep` INT NOT NULL,
+  `agreement_list_id` INT NULL,
+  PRIMARY KEY (`agreement_procedure_id`, `agreement_ptep`),
+  INDEX `agreementProcedure_id` (`agreement_procedure_id` ASC),
+  INDEX `fk_agreementList_id_idx` (`agreement_list_id` ASC),
+  CONSTRAINT `fk_agreementProcedure_id2name`
+    FOREIGN KEY (`agreement_procedure_id`)
+    REFERENCES `agreement_procedures_names` (`agreement_procedure_id`)
     ON DELETE CASCADE
     ON UPDATE CASCADE,
   CONSTRAINT `fk_agreementList_id`
-    FOREIGN KEY (`agreementList_id`)
-    REFERENCES `agreementLists` (`agreementList_id`)
+    FOREIGN KEY (`agreement_list_id`)
+    REFERENCES `agreement_lists` (`agreement_list_id`)
     ON DELETE CASCADE
     ON UPDATE CASCADE)
 ENGINE = InnoDB
@@ -112,12 +112,12 @@ CREATE TABLE IF NOT EXISTS `project_agreement` (
   `project_id` INT NOT NULL,
   `tracker_id` INT NOT NULL,
   `status_id` INT NOT NULL,
-  `agreementProcedure_id` INT NULL,
+  `agreement_procedure_id` INT NULL,
   PRIMARY KEY (`project_id`, `tracker_id`, `status_id`),
-  INDEX `fk_project_agreement_1_idx` (`agreementProcedure_id` ASC),
+  INDEX `fk_project_agreement_1_idx` (`agreement_procedure_id` ASC),
   CONSTRAINT `fk_agreementProcedure_id`
-    FOREIGN KEY (`agreementProcedure_id`)
-    REFERENCES `agreementProcedures` (`agreementProcedure_id`)
+    FOREIGN KEY (`agreement_procedure_id`)
+    REFERENCES `agreement_procedures` (`agreement_procedure_id`)
     ON DELETE CASCADE
     ON UPDATE CASCADE)
 ENGINE = InnoDB
@@ -136,18 +136,18 @@ ENGINE = InnoDB;
 
 
 -- -----------------------------------------------------
+-- Table `agreement_step_name`
 -- -----------------------------------------------------
-DROP TABLE IF EXISTS `agreementStepName` ;
+DROP TABLE IF EXISTS `agreement_step_name` ;
 
-CREATE TABLE IF NOT EXISTS `agreementStepName` (
-  `agreementProcedure_id` INT NOT NULL AUTO_INCREMENT,
-  `agreementStep` INT NOT NULL,
-  `agreementStep_name` VARCHAR(45) NULL,
-  PRIMARY KEY (`agreementProcedure_id`, `agreementStep`),
+CREATE TABLE IF NOT EXISTS `agreement_step_name` (
+  `agreement_procedure_id` INT NOT NULL AUTO_INCREMENT,
+  `agreement_step` INT NOT NULL,
+  `agreement_step_name` VARCHAR(45) NULL,
+  PRIMARY KEY (`agreement_procedure_id`, `agreement_step`),
   CONSTRAINT `fk_agreementStep`
-    FOREIGN KEY (`agreementProcedure_id` , `agreementStep`)
-    REFERENCES `agreementProcedures` (`agreementProcedure_id` , `agreementStep`)
+    FOREIGN KEY (`agreement_procedure_id` , `agreement_step`)
+    REFERENCES `agreement_procedures` (`agreement_procedure_id` , `agreement_ptep`)
     ON DELETE CASCADE
     ON UPDATE CASCADE)
 ENGINE = InnoDB
@@ -156,30 +156,30 @@ COLLATE = utf8_general_ci;
 
 
 -- -----------------------------------------------------
+-- Table `agreement_signatures`
 -- -----------------------------------------------------
-DROP TABLE IF EXISTS `agreementSignatures` ;
+DROP TABLE IF EXISTS `agreement_signatures` ;
 
-CREATE TABLE IF NOT EXISTS `agreementSignatures` (
-  `agreementSignature_id` INT NOT NULL AUTO_INCREMENT,
+CREATE TABLE IF NOT EXISTS `agreement_signatures` (
+  `agreement_signature_id` INT NOT NULL AUTO_INCREMENT,
   `user_id` INT NOT NULL,
   `issue_id` INT NOT NULL,
-  `agreementStep` INT NOT NULL,
-  `agreementSignatureType_id` INT NOT NULL,
-  `agreementSignature_registeredId` INT NOT NULL,
-  `agreementSignature_ts` TIMESTAMP NULL DEFAULT NOW(),
-  `agreementSignature_object` LONGBLOB NOT NULL,
-  `agreementSignature_signature` LONGBLOB NOT NULL,
-  `agreementSignature_verifyData` LONGBLOB NULL,
-  PRIMARY KEY (`agreementSignature_id`),
-  INDEX `fk_agreementSignatures_1_idx` (`agreementSignatureType_id` ASC),
-  INDEX `issueStep` (`issue_id` ASC, `agreementStep` ASC),
-  INDEX `userIssueStep` (`user_id` ASC, `issue_id` ASC, `agreementStep` ASC),
+  `agreement_step` INT NOT NULL,
+  `agreement_signature_type_id` INT NOT NULL,
+  `agreement_signature_registered_id` INT NOT NULL,
+  `agreement_signature_ts` TIMESTAMP NULL DEFAULT NOW(),
+  `agreement_signature_object` LONGBLOB NOT NULL,
+  `agreement_signature_signature` LONGBLOB NOT NULL,
+  `agreement_signature_verifydata` LONGBLOB NULL,
+  PRIMARY KEY (`agreement_signature_id`),
+  INDEX `fk_agreementSignatures_1_idx` (`agreement_signature_type_id` ASC),
+  INDEX `issueStep` (`issue_id` ASC, `agreement_step` ASC),
+  INDEX `userIssueStep` (`user_id` ASC, `issue_id` ASC, `agreement_step` ASC),
   INDEX `user` (`user_id` ASC),
-  INDEX `type` (`agreementSignatureType_id` ASC),
-  CONSTRAINT `fk_agreementSignatureType_id`
-    FOREIGN KEY (`agreementSignatureType_id`)
-    REFERENCES `agreementSignaturesTypes` (`agreementSignatureType_id`)
+  INDEX `type` (`agreement_signature_type_id` ASC),
+  CONSTRAINT `fk_agreementSignatureType_id_fact`
+    FOREIGN KEY (`agreement_signature_type_id`)
+    REFERENCES `agreement_signatures_types` (`agreement_signature_type_id`)
     ON DELETE RESTRICT
     ON UPDATE RESTRICT)
 ENGINE = InnoDB