forked from scotch-io/node-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
grudio.sql
170 lines (141 loc) · 4.34 KB
/
grudio.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
168
169
170
-- phpMyAdmin SQL Dump
-- version 4.2.12deb2+deb8u1build0.15.04.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 11, 2017 at 06:44 PM
-- Server version: 5.6.28-0ubuntu0.15.04.1
-- PHP Version: 5.6.4-4ubuntu6.4
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: `grudio`
--
-- --------------------------------------------------------
--
-- Table structure for table `category`
--
CREATE TABLE IF NOT EXISTS `category` (
`id` int(11) NOT NULL,
`name` varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `songs`
--
CREATE TABLE IF NOT EXISTS `songs` (
`id` int(11) NOT NULL,
`name` varchar(250) NOT NULL,
`upvote_count` int(11) NOT NULL DEFAULT '0',
`downvote_count` int(11) NOT NULL DEFAULT '0',
`score` int(11) NOT NULL DEFAULT '0',
`category_id` int(11) NOT NULL,
`url` varchar(500) NOT NULL,
`file_path` varchar(600) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`last_played` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) unsigned NOT NULL,
`first_name` varchar(30) NOT NULL DEFAULT '',
`last_name` varchar(30) NOT NULL DEFAULT '',
`email` varchar(30) NOT NULL DEFAULT '',
`password` varchar(60) NOT NULL DEFAULT '',
`created` datetime NOT NULL,
`modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`lastlogin` timestamp NULL DEFAULT NULL,
`salt` varchar(50) NOT NULL DEFAULT ''
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `first_name`, `last_name`, `email`, `password`, `created`, `modified`, `lastlogin`, `salt`) VALUES
(18, '', '', 'p4prashant21@gmail.com', '27537b3390864b72f09c7a305b7a29dd5f1d582b', '2017-02-11 08:39:35', '2017-02-11 08:39:35', NULL, '751383247727');
-- --------------------------------------------------------
--
-- Table structure for table `user_songs`
--
CREATE TABLE IF NOT EXISTS `user_songs` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`sond_id` int(11) NOT NULL,
`upvote` tinyint(1) NOT NULL,
`downvote` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `user_upvote`
--
CREATE TABLE IF NOT EXISTS `user_upvote` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`upvote` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `category`
--
ALTER TABLE `category`
ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `name` (`name`);
--
-- Indexes for table `songs`
--
ALTER TABLE `songs`
ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `name` (`name`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `email` (`email`);
--
-- Indexes for table `user_songs`
--
ALTER TABLE `user_songs`
ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `user_song_unique` (`user_id`,`sond_id`);
--
-- Indexes for table `user_upvote`
--
ALTER TABLE `user_upvote`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `category`
--
ALTER TABLE `category`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `songs`
--
ALTER TABLE `songs`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT for table `user_songs`
--
ALTER TABLE `user_songs`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `user_upvote`
--
ALTER TABLE `user_upvote`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
/*!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 */;