· 8 years ago · Jul 18, 2018, 06:04 PM
1/*
2MySQL Backup
3Database: vauhdi
4Backup Time: 2018-07-18 20:00:10
5*/
6
7SET FOREIGN_KEY_CHECKS=0;
8DROP TABLE IF EXISTS `vauhdi`.`polls`;
9DROP TABLE IF EXISTS `vauhdi`.`polls_answers`;
10DROP TABLE IF EXISTS `vauhdi`.`polls_questions`;
11CREATE TABLE `polls` (
12 `id` int(11) NOT NULL AUTO_INCREMENT,
13 `title` varchar(255) NOT NULL DEFAULT 'Hey! We''d appreciate it if you could take some time to answer these questions. It will help improve our hotel.',
14 `thanks_message` varchar(255) NOT NULL,
15 `reward_badge` varchar(10) NOT NULL DEFAULT '',
16 PRIMARY KEY (`id`)
17) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
18CREATE TABLE `polls_answers` (
19 `poll_id` int(11) NOT NULL,
20 `user_id` int(11) NOT NULL,
21 `question_id` int(11) NOT NULL,
22 `answer` varchar(255) NOT NULL,
23 UNIQUE KEY `unique_index` (`poll_id`,`user_id`,`question_id`)
24) ENGINE=MyISAM DEFAULT CHARSET=latin1;
25CREATE TABLE `polls_questions` (
26 `id` int(11) NOT NULL AUTO_INCREMENT,
27 `parent_id` int(11) NOT NULL DEFAULT '0',
28 `poll_id` int(11) NOT NULL,
29 `order` int(11) NOT NULL,
30 `question` varchar(255) NOT NULL,
31 `type` int(11) NOT NULL DEFAULT '2',
32 `min_selections` int(11) NOT NULL DEFAULT '1',
33 `options` varchar(255) NOT NULL,
34 PRIMARY KEY (`id`)
35) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
36BEGIN;
37LOCK TABLES `vauhdi`.`polls` WRITE;
38DELETE FROM `vauhdi`.`polls`;
39INSERT INTO `vauhdi`.`polls` (`id`,`title`,`thanks_message`,`reward_badge`) VALUES (1, 'Kysely', 'Kiitos vastauksestasi!', 'BR461');
40UNLOCK TABLES;
41COMMIT;
42BEGIN;
43LOCK TABLES `vauhdi`.`polls_answers` WRITE;
44DELETE FROM `vauhdi`.`polls_answers`;
45INSERT INTO `vauhdi`.`polls_answers` (`poll_id`,`user_id`,`question_id`,`answer`) VALUES (1, 1, 0, '');
46UNLOCK TABLES;
47COMMIT;
48BEGIN;
49LOCK TABLES `vauhdi`.`polls_questions` WRITE;
50DELETE FROM `vauhdi`.`polls_questions`;
51UNLOCK TABLES;
52COMMIT;