-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.sql
103 lines (84 loc) · 3.06 KB
/
database.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
-- phpMyAdmin SQL Dump
-- version 4.5.2-dev
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 08, 2015 at 08:12 PM
-- Server version: 5.5.44-0ubuntu0.14.04.1-log
-- PHP Version: 5.5.9-1ubuntu4.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `feli_jugaad`
--
-- --------------------------------------------------------
--
-- Table structure for table `files`
--
CREATE TABLE IF NOT EXISTS `files` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`slug` varchar(255) COLLATE utf8_bin NOT NULL,
`parent` int(11) NOT NULL,
`type` enum('directory','file') COLLATE utf8_bin NOT NULL,
`default_role` enum('none','reader','author','admin') COLLATE utf8_bin NOT NULL DEFAULT 'reader',
`template` varchar(255) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uniqueName` (`slug`,`parent`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Dumping data for table `files`
--
INSERT INTO `files` (`id`, `slug`, `parent`, `type`, `default_role`, `template`) VALUES
(0, '', -1, 'directory', 'reader', '');
-- --------------------------------------------------------
--
-- Table structure for table `file_data`
--
CREATE TABLE IF NOT EXISTS `file_data` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`file_id` int(11) NOT NULL,
`version_id` int(11) NOT NULL,
`name` varchar(64) NOT NULL,
`value` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `file_permissions`
--
CREATE TABLE IF NOT EXISTS `file_permissions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`file_id` int(11) NOT NULL,
`user` varchar(255) COLLATE utf8_bin NOT NULL,
`role` enum('none','reader','author','admin') COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uniqueUser` (`file_id`,`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- --------------------------------------------------------
--
-- Table structure for table `file_versions`
--
CREATE TABLE IF NOT EXISTS `file_versions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`file_id` int(11) NOT NULL,
`action` enum('create','edit','delete','recover') COLLATE utf8_bin NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created_by` varchar(255) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- --------------------------------------------------------
--
-- Table structure for table `trash_files`
--
CREATE TABLE IF NOT EXISTS `trash_files` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`file_id` int(11) NOT NULL,
`name` varchar(255) COLLATE utf8_bin NOT NULL,
`slug` varchar(255) COLLATE utf8_bin NOT NULL,
`parent` int(11) NOT NULL,
`type` enum('directory','file') COLLATE utf8_bin NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created_by` varchar(255) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `file_id` (`file_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;