forked from scorelab/Bassa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bassa.sql
138 lines (113 loc) · 3.35 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Dec 22, 2017 at 02:57 PM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
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 utf8mb4 */;
--
-- Database: `Bassa`
--
-- --------------------------------------------------------
--
-- Table structure for table `download`
--
CREATE TABLE `download` (
`id` bigint(20) NOT NULL,
`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
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `rate`
--
CREATE TABLE `rate` (
`user_name` varchar(256) NOT NULL,
`id` bigint(20) NOT NULL,
`rate` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `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'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`user_name`, `password`, `auth`, `email`, `blocked`, `approved`) VALUES
('rand', '1a1dc91c907325c69271ddf0c944bc72', 0, '[email protected]', 0, 1),
('rush', '1a1dc91c907325c69271ddf0c944bc72', 1, '[email protected]', 0, 0),
('tom', '1a1dc91c907325c69271ddf0c944bc72', 0, '[email protected]', 0, 0);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `download`
--
ALTER TABLE `download`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `id` (`id`),
ADD KEY `user_name` (`user_name`);
--
-- Indexes for table `rate`
--
ALTER TABLE `rate`
ADD PRIMARY KEY (`user_name`,`id`),
ADD KEY `id` (`id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`user_name`),
ADD UNIQUE KEY `user_name` (`user_name`),
ADD UNIQUE KEY `email` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `download`
--
ALTER TABLE `download`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
--
-- 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`);
COMMIT;
/*!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 */;