-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathletter.sql
121 lines (103 loc) · 3.52 KB
/
letter.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
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50508
Source Host : localhost:3306
Source Database : letter
Target Server Type : MYSQL
Target Server Version : 50508
File Encoding : 65001
Date: 2011-09-28 16:50:52
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `attachments`
-- ----------------------------
DROP TABLE IF EXISTS `attachments`;
CREATE TABLE `attachments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`letter_id` int(11) NOT NULL,
`path` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `companies`
-- ----------------------------
DROP TABLE IF EXISTS `companies`;
CREATE TABLE `companies` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`shortname` varchar(11) NOT NULL,
`address` varchar(255) DEFAULT NULL,
`telephone` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `companies_letters`
-- ----------------------------
DROP TABLE IF EXISTS `companies_letters`;
CREATE TABLE `companies_letters` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`company_id` int(11) NOT NULL,
`letter_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `letters`
-- ----------------------------
DROP TABLE IF EXISTS `letters`;
CREATE TABLE `letters` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`situation` int(11) unsigned NOT NULL,
`ref` varchar(255) NOT NULL,
`date` date NOT NULL,
`user_id` int(11) DEFAULT NULL,
`filenumber` varchar(255) DEFAULT NULL,
`fax` tinyint(1) unsigned NOT NULL,
`email` tinyint(1) unsigned NOT NULL,
`letter` tinyint(1) unsigned NOT NULL,
`subject` varchar(255) DEFAULT NULL,
`related` varchar(255) DEFAULT NULL,
`restricted` tinyint(1) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `letters_projects`
-- ----------------------------
DROP TABLE IF EXISTS `letters_projects`;
CREATE TABLE `letters_projects` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`letter_id` int(11) NOT NULL,
`project_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `projects`
-- ----------------------------
DROP TABLE IF EXISTS `projects`;
CREATE TABLE `projects` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `users`
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`initial` varchar(10) NOT NULL,
`position` varchar(255) DEFAULT NULL,
`degree` varchar(255) DEFAULT NULL,
`username` varchar(50) DEFAULT NULL,
`password` varchar(40) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of users
-- ----------------------------
INSERT INTO `users` VALUES ('2', 'test', 'T', 'T', 'T', 'test', '2d87000e65e68967d1d242d0083ef3c4834fad00');