-
Notifications
You must be signed in to change notification settings - Fork 0
/
gengslim.sql
141 lines (116 loc) · 3.31 KB
/
gengslim.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
-- phpMyAdmin SQL Dump
-- version 4.7.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8886
-- Generation Time: May 12, 2018 at 04:30 PM
-- Server version: 5.6.35
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `feng_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `options`
--
CREATE TABLE `options` (
`id` bigint(20) NOT NULL,
`text` varchar(255) NOT NULL,
`value` varchar(255) NOT NULL,
`id_questions` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `options`
--
INSERT INTO `options` (`id`, `text`, `value`, `id_questions`) VALUES
(1, 'Front-end', 'front-end', 2),
(2, 'Back-end', 'back-end', 2);
-- --------------------------------------------------------
--
-- Table structure for table `questions`
--
CREATE TABLE `questions` (
`id` bigint(20) NOT NULL,
`id_records` bigint(20) NOT NULL,
`text` varchar(255) NOT NULL,
`type` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `questions`
--
INSERT INTO `questions` (`id`, `id_records`, `text`, `type`) VALUES
(1, 1, 'Qual o seu nome?', 'text'),
(2, 1, 'Para qual área você está aplicando?', 'select');
-- --------------------------------------------------------
--
-- Table structure for table `records`
--
CREATE TABLE `records` (
`id` bigint(20) NOT NULL,
`name` varchar(255) NOT NULL,
`description` varchar(255) NOT NULL,
`category` varchar(100) NOT NULL,
`basePoints` int(10) NOT NULL,
`startDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`endDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`alreadyAnswered` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `records`
--
INSERT INTO `records` (`id`, `name`, `description`, `category`, `basePoints`, `startDate`, `endDate`, `isActive`, `alreadyAnswered`) VALUES
(1, 'Teste de desenvolvimento', 'Teste para desenvolvedor back-end', 'Testes', 100, '2018-02-15 02:00:00', '2018-02-22 03:00:00', 1, 0);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `options`
--
ALTER TABLE `options`
ADD PRIMARY KEY (`id`),
ADD KEY `id_fk_id_questions` (`id_questions`);
--
-- Indexes for table `questions`
--
ALTER TABLE `questions`
ADD PRIMARY KEY (`id`),
ADD KEY `id_fk_id_records` (`id_records`);
--
-- Indexes for table `records`
--
ALTER TABLE `records`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `options`
--
ALTER TABLE `options`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `questions`
--
ALTER TABLE `questions`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `records`
--
ALTER TABLE `records`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `options`
--
ALTER TABLE `options`
ADD CONSTRAINT `id_fk_id_questions` FOREIGN KEY (`id_questions`) REFERENCES `questions` (`id`);
--
-- Constraints for table `questions`
--
ALTER TABLE `questions`
ADD CONSTRAINT `id_fk_id_records` FOREIGN KEY (`id_records`) REFERENCES `records` (`id`);