· 10 years ago · Aug 25, 2016, 02:28 PM
1
2--
3-- Table structure for table `user`
4--
5
6CREATE TABLE IF NOT EXISTS `user` (
7 `id` int(11) NOT NULL AUTO_INCREMENT,
8 `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
9 `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
10 `password_hash` varchar(60) COLLATE utf8_unicode_ci NOT NULL,
11 `auth_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
12 `confirmed_at` int(11) DEFAULT NULL,
13 `unconfirmed_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
14 `blocked_at` int(11) DEFAULT NULL,
15 `registration_ip` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
16 `created_at` int(11) NOT NULL,
17 `updated_at` int(11) NOT NULL,
18 `flags` int(11) NOT NULL DEFAULT '0',
19 PRIMARY KEY (`id`),
20 UNIQUE KEY `user_unique_email` (`email`),
21 UNIQUE KEY `user_unique_username` (`username`)
22) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
23
24--
25-- Dumping data for table `user`
26--
27
28INSERT INTO `user` (`id`, `username`, `email`, `password_hash`, `auth_key`, `confirmed_at`, `unconfirmed_email`, `blocked_at`, `registration_ip`, `created_at`, `updated_at`, `flags`) VALUES
29(1, 'admin', 'support@hosannahighertech.co.tz', '$2y$12$cQS9/410F56/8ioLJ4GvWOscmT8buF4iaR.RX48Tp.5yIpcdF/BaG', '6l_mIr_r85HYhEnPNyRMun_LFRPZkDty', 1471347163, NULL, NULL, '127.0.0.1', 1471347163, 1471347163, 0);
30
31--
32-- Dumping data for table `profile`
33--
34
35INSERT INTO `profile` (`user_id`, `name`, `public_email`, `gravatar_email`, `gravatar_id`, `location`, `website`, `bio`) VALUES
36(1, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
37
38-- --------------------------------------------------------
39
40--
41-- Table structure for table `Reference`
42--
43
44CREATE TABLE IF NOT EXISTS `Reference` (
45 `values` int(11) NOT NULL,
46 PRIMARY KEY (`values`)
47) ENGINE=InnoDB DEFAULT CHARSET=utf8;
48
49--
50-- Dumping data for table `Reference`
51--
52
53INSERT INTO `Reference` (`values`) VALUES
54(0),
55(1),
56(2),
57(3),
58(4),
59(5),
60(6),
61(7),
62(8),
63(9),
64(10),
65(11),
66(12),
67(13),
68(14),
69(15),
70(16),
71(17),
72(18),
73(19),
74(20),
75(21),
76(22),
77(23);
78
79-- --------------------------------------------------------
80
81--
82-- Table structure for table `social_account`
83--
84
85CREATE TABLE IF NOT EXISTS `social_account` (
86 `id` int(11) NOT NULL AUTO_INCREMENT,
87 `user_id` int(11) DEFAULT NULL,
88 `provider` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
89 `client_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
90 `data` text COLLATE utf8_unicode_ci,
91 `code` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
92 `created_at` int(11) DEFAULT NULL,
93 `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
94 `username` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
95 PRIMARY KEY (`id`),
96 UNIQUE KEY `account_unique` (`provider`,`client_id`),
97 UNIQUE KEY `account_unique_code` (`code`),
98 KEY `fk_user_account` (`user_id`)
99) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
100
101-- --------------------------------------------------------
102
103--
104-- Table structure for table `token`
105--
106
107CREATE TABLE IF NOT EXISTS `token` (
108 `user_id` int(11) NOT NULL,
109 `code` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
110 `created_at` int(11) NOT NULL,
111 `type` smallint(6) NOT NULL,
112 UNIQUE KEY `token_unique` (`user_id`,`code`,`type`)
113) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
114
115-- --------------------------------------------------------
116
117--
118-- Constraints for dumped tables
119--
120
121--
122-- Constraints for table `CMR`
123--
124ALTER TABLE `CMR`
125 ADD CONSTRAINT `fk_CMR_CallID` FOREIGN KEY (`globalCallID_callId`) REFERENCES `CDR` (`globalCallID_callId`) ON DELETE NO ACTION ON UPDATE NO ACTION;
126
127--
128-- Constraints for table `profile`
129--
130ALTER TABLE `profile`
131 ADD CONSTRAINT `fk_user_profile` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;
132
133--
134-- Constraints for table `social_account`
135--
136ALTER TABLE `social_account`
137 ADD CONSTRAINT `fk_user_account` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;
138
139--
140-- Constraints for table `token`
141--
142ALTER TABLE `token`
143 ADD CONSTRAINT `fk_user_token` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE;