This repository has been archived by the owner on Oct 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kajes_linkify.sql
138 lines (116 loc) · 3.3 KB
/
kajes_linkify.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.5.1
-- http://www.phpmyadmin.net
--
-- Värd: 127.0.0.1
-- Tid vid skapande: 23 jan 2017 kl 15:01
-- Serverversion: 10.1.16-MariaDB
-- PHP-version: 7.0.9
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 utf8mb4 */;
--
-- Databas: `kajes_linkify`
--
CREATE DATABASE IF NOT EXISTS `kajes_linkify` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `kajes_linkify`;
-- --------------------------------------------------------
--
-- Tabellstruktur `posts`
--
DROP TABLE IF EXISTS `posts`;
CREATE TABLE `posts` (
`postID` int(10) UNSIGNED NOT NULL,
`authorID` int(10) UNSIGNED NOT NULL,
`post_title` varchar(255) DEFAULT NULL,
`post_link` varchar(255) DEFAULT NULL,
`post_content` text,
`posted_on` datetime DEFAULT NULL,
`updated_on` datetime DEFAULT NULL,
`voteCount` int(11) DEFAULT '0',
`parent_id` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Tabellstruktur `tokens`
--
DROP TABLE IF EXISTS `tokens`;
CREATE TABLE `tokens` (
`cookieID` int(10) UNSIGNED NOT NULL,
`uid` int(10) UNSIGNED NOT NULL,
`first` varchar(128) DEFAULT NULL,
`second` varchar(256) DEFAULT NULL,
`expire` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Tabellstruktur `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`uid` int(10) UNSIGNED NOT NULL,
`name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(60) NOT NULL,
`bio` mediumtext,
`avatarID` varchar(100) DEFAULT NULL,
`avatarImageType` varchar(4) DEFAULT NULL,
`votedOn` varchar(1000) NOT NULL DEFAULT '[]'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Index för dumpade tabeller
--
--
-- Index för tabell `posts`
--
ALTER TABLE `posts`
ADD PRIMARY KEY (`postID`),
ADD KEY `authorID` (`authorID`);
--
-- Index för tabell `tokens`
--
ALTER TABLE `tokens`
ADD PRIMARY KEY (`cookieID`),
ADD KEY `uid` (`uid`);
--
-- Index för tabell `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`uid`);
--
-- AUTO_INCREMENT för dumpade tabeller
--
--
-- AUTO_INCREMENT för tabell `posts`
--
ALTER TABLE `posts`
MODIFY `postID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=45;
--
-- AUTO_INCREMENT för tabell `tokens`
--
ALTER TABLE `tokens`
MODIFY `cookieID` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
--
-- AUTO_INCREMENT för tabell `users`
--
ALTER TABLE `users`
MODIFY `uid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
--
-- Restriktioner för dumpade tabeller
--
--
-- Restriktioner för tabell `posts`
--
ALTER TABLE `posts`
ADD CONSTRAINT `posts_ibfk_1` FOREIGN KEY (`authorID`) REFERENCES `users` (`uid`);
--
-- Restriktioner för tabell `tokens`
--
ALTER TABLE `tokens`
ADD CONSTRAINT `tokens_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `users` (`uid`);
/*!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 */;