forked from scorelab/Bassa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBassa.sql
115 lines (94 loc) · 3.17 KB
/
Bassa.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
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 29, 2016 at 10:21 PM
-- Server version: 5.5.44-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.11
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: `Bassa`
--
CREATE DATABASE IF NOT EXISTS `Bassa` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `Bassa`;
-- --------------------------------------------------------
--
-- Table structure for table `download`
--
CREATE TABLE IF NOT EXISTS `download` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`link` text NOT NULL,
`user_name` varchar(256) NOT NULL,
`download_name` varchar(256) NOT NULL,
`added_time` bigint(20) NOT NULL,
`status` tinyint(4) NOT NULL DEFAULT '0',
`rating` tinyint(4) NOT NULL DEFAULT '0',
`gid` varchar(256) DEFAULT NULL,
`completed_time` bigint(20) NOT NULL DEFAULT '0',
`size` varchar(7) NOT NULL DEFAULT '0',
`path` text,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
KEY `user_name` (`user_name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;
--
-- Table structure for table `rate`
--
CREATE TABLE IF NOT EXISTS `rate` (
`user_name` varchar(256) NOT NULL,
`id` bigint(20) NOT NULL,
`rate` tinyint(1) NOT NULL,
PRIMARY KEY (`user_name`,`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `rate`
--
INSERT INTO `rate` (`user_name`, `id`, `rate`) VALUES
('rand', 8, 1),
('tom', 8, 5);
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`user_name` varchar(256) NOT NULL,
`password` varchar(256) NOT NULL,
`auth` tinyint(11) NOT NULL,
`email` varchar(256) NOT NULL,
`blocked` tinyint(1) NOT NULL DEFAULT '0',
`approved` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`user_name`),
UNIQUE KEY `user_name` (`user_name`),
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`user_name`, `password`, `auth`, `email`, `blocked`, `approved`) VALUES
('rand', '1a1dc91c907325c69271ddf0c944bc72', 0, 'dilankachathurangi@gmail.com', 0, 1),
('rush', '1a1dc91c907325c69271ddf0c944bc72', 1, 'mgdmadusanka@gmail.com', 0, 0),
('tom', '1a1dc91c907325c69271ddf0c944bc72', 0, 'tom@mail.com', 0, 0);
--
-- Constraints for dumped tables
--
--
-- Constraints for table `download`
--
ALTER TABLE `download`
ADD CONSTRAINT `download_ibfk_1` FOREIGN KEY (`user_name`) REFERENCES `user` (`user_name`);
--
-- Constraints for table `rate`
--
ALTER TABLE `rate`
ADD CONSTRAINT `rate_ibfk_1` FOREIGN KEY (`user_name`) REFERENCES `user` (`user_name`),
ADD CONSTRAINT `rate_ibfk_2` FOREIGN KEY (`id`) REFERENCES `download` (`id`);
/*!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 */;