forked from amarjeetkapoor1/Sim
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Sim.sql
167 lines (135 loc) · 4.77 KB
/
Sim.sql
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 24, 2016 at 06:17 PM
-- Server version: 5.5.46-0ubuntu0.14.04.2
-- PHP Version: 5.5.9-1ubuntu4.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `Sim`
--
-- --------------------------------------------------------
--
-- Table structure for table `Job`
--
CREATE TABLE IF NOT EXISTS `Job` (
`job_id` int(10) NOT NULL AUTO_INCREMENT,
`idd` varchar(24) DEFAULT NULL,
`name` varchar(10) DEFAULT NULL,
`date` varchar(10) DEFAULT NULL,
`client` varchar(24) DEFAULT NULL,
`comment` text,
`checker_name` varchar(24) DEFAULT NULL,
`engineer_name` varchar(24) DEFAULT NULL,
`approved_name` varchar(24) DEFAULT NULL,
`checker_date` varchar(10) DEFAULT NULL,
`ref` varchar(24) DEFAULT NULL,
`part` varchar(24) DEFAULT NULL,
`rev` varchar(24) DEFAULT NULL,
`approved_date` varchar(10) DEFAULT NULL,
PRIMARY KEY (`job_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `Job_material`
--
CREATE TABLE IF NOT EXISTS `Job_material` (
`job_id` int(24) NOT NULL DEFAULT '0',
`name` varchar(24) NOT NULL,
`E` double DEFAULT NULL,
`poisson` double DEFAULT NULL,
`density` double DEFAULT NULL,
`damp` double DEFAULT NULL,
`alpha` double DEFAULT NULL,
`G` double DEFAULT NULL,
`strength` varchar(24) DEFAULT NULL,
`type` varchar(24) DEFAULT NULL,
PRIMARY KEY (`name`,`job_id`),
KEY `fk_job_id` (`job_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `Joint`
--
CREATE TABLE IF NOT EXISTS `Joint` (
`job_id` int(10) NOT NULL DEFAULT '0',
`idd` int(10) NOT NULL,
`x` double NOT NULL,
`y` double NOT NULL,
`z` double DEFAULT NULL,
`support` varchar(10) DEFAULT NULL,
PRIMARY KEY (`idd`,`job_id`),
KEY `fk_job_id2` (`job_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `Member`
--
CREATE TABLE IF NOT EXISTS `Member` (
`job_id` int(10) NOT NULL DEFAULT '0',
`member_id` int(10) NOT NULL DEFAULT '0',
`member_property` int(10) DEFAULT NULL,
PRIMARY KEY (`member_id`,`job_id`),
KEY `fk_job_id1` (`job_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table structure for table `Member_incidence`
--
CREATE TABLE IF NOT EXISTS `Member_incidence` (
`job_id` int(10) NOT NULL DEFAULT '0',
`member_id` int(10) NOT NULL DEFAULT '0',
`joint_id` int(10) NOT NULL DEFAULT '0',
PRIMARY KEY (`job_id`,`member_id`,`joint_id`),
KEY `fk_member_id` (`member_id`),
KEY `fk_joint_id` (`joint_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `Member_property`
--
CREATE TABLE IF NOT EXISTS `Member_property` (
`job_id` int(10) NOT NULL DEFAULT '0',
`idd` int(10) NOT NULL,
`type` varchar(24) NOT NULL,
`YD` float DEFAULT NULL,
`ZD` float DEFAULT NULL,
PRIMARY KEY (`idd`,`job_id`),
KEY `fk_job_id4` (`job_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Constraints for table `Job_material`
--
ALTER TABLE `Job_material`
ADD CONSTRAINT `fk_job_id` FOREIGN KEY (`job_id`) REFERENCES `Job` (`job_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `Joint`
--
ALTER TABLE `Joint`
ADD CONSTRAINT `fk_job_id2` FOREIGN KEY (`job_id`) REFERENCES `Job` (`job_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `Member`
--
ALTER TABLE `Member`
ADD CONSTRAINT `fk_job_id1` FOREIGN KEY (`job_id`) REFERENCES `Job` (`job_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `Member_incidence`
--
ALTER TABLE `Member_incidence`
ADD CONSTRAINT `fk_joint_id` FOREIGN KEY (`joint_id`) REFERENCES `Joint` (`idd`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `fk_job_id3` FOREIGN KEY (`job_id`) REFERENCES `Job` (`job_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `fk_member_id` FOREIGN KEY (`member_id`) REFERENCES `Member` (`member_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `Member_property`
--
ALTER TABLE `Member_property`
ADD CONSTRAINT `fk_job_id4` FOREIGN KEY (`job_id`) REFERENCES `Job` (`job_id`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;