-
Notifications
You must be signed in to change notification settings - Fork 5
/
Simplet.sql
92 lines (92 loc) · 3.02 KB
/
Simplet.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
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
CREATE DATABASE IF NOT EXISTS `Simplet` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `Simplet`;
-- Create Table for Members
CREATE TABLE IF NOT EXISTS `Members` (
`ID` varchar(12) NOT NULL,
`Mail` varchar(250) NOT NULL,
`Name` varchar(250) NOT NULL,
`Pass` varchar(1000) NOT NULL,
`Salt` varchar(64) NOT NULL,
`Admin` int(1) NOT NULL,
`Created` int(11) NOT NULL,
`Modified` int(11) NOT NULL,
`Status` varchar(100) NOT NULL,
UNIQUE KEY `ID` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Create Table for Sessions
CREATE TABLE IF NOT EXISTS `Sessions` (
`ID` int(255) NOT NULL AUTO_INCREMENT,
`Member_ID` varchar(12) NOT NULL,
`Mail` varchar(255) NOT NULL,
`IP` varchar(255) NOT NULL,
`Cookie` varchar(64) NOT NULL,
`Active` int(1) NOT NULL,
`Created` int(11) NOT NULL,
`Modified` int(11) NOT NULL,
UNIQUE KEY `ID` (`ID`),
KEY `Member_ID` (`Member_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Create Table for Password Resets
CREATE TABLE IF NOT EXISTS `Resets` (
`Member_ID` varchar(12) NOT NULL,
`Mail` varchar(255) NOT NULL,
`Key` varchar(64) NOT NULL,
`Active` int(1) NOT NULL,
`IP` varchar(255) NOT NULL,
`Created` int(11) NOT NULL,
`Modified` int(11) NOT NULL,
UNIQUE KEY `Key` (`Key`),
KEY `Member_ID` (`Member_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Create Table for Failed Logins
CREATE TABLE IF NOT EXISTS `Failures` (
`ID` int(255) NOT NULL AUTO_INCREMENT,
`Member_ID` varchar(12) NOT NULL,
`Mail` varchar(255) NOT NULL,
`IP` varchar(255) NOT NULL,
`Created` int(11) NOT NULL,
UNIQUE KEY `ID` (`ID`),
KEY `Member_ID` (`Member_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Create Table for Categories
CREATE TABLE IF NOT EXISTS `Categories` (
`ID` int(255) NOT NULL AUTO_INCREMENT,
`Member_ID` varchar(12) NOT NULL,
`Status` varchar(12) NOT NULL,
`Title` varchar(255) NOT NULL,
`Slug` varchar(255) NOT NULL,
`Description` varchar(255) NOT NULL,
`Created` int(11) NOT NULL,
`Modified` int(11) NOT NULL,
UNIQUE KEY `ID` (`ID`),
KEY `Member_ID` (`Member_ID`),
KEY `Title` (`Title`),
KEY `Slug` (`Slug`)
-- Create Table for Topics
CREATE TABLE IF NOT EXISTS `Topics` (
`ID` int(255) NOT NULL AUTO_INCREMENT,
`Member_ID` varchar(12) NOT NULL,
`Status` varchar(12) NOT NULL,
`Category` varchar(255) NOT NULL,
`Title` varchar(500) NOT NULL,
`Created` int(11) NOT NULL,
`Modified` int(11) NOT NULL,
UNIQUE KEY `ID` (`ID`),
KEY `Member_ID` (`Member_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Create Table for Replies
CREATE TABLE IF NOT EXISTS `Replies` (
`ID` int(255) NOT NULL AUTO_INCREMENT,
`Member_ID` varchar(12) NOT NULL,
`Topic_ID` varchar(255) NOT NULL,
`Status` varchar(12) NOT NULL,
`Post` MEDIUMTEXT NOT NULL,
`Created` int(11) NOT NULL,
`Modified` int(11) NOT NULL,
UNIQUE KEY `ID` (`ID`),
KEY `Member_ID` (`Member_ID`),
KEY `Topic_ID` (`Topic_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;