212 lines
5.1 KiB
SQL
212 lines
5.1 KiB
SQL
-- phpMyAdmin SQL Dump
|
|
-- version 4.6.4deb1
|
|
-- https://www.phpmyadmin.net/
|
|
--
|
|
-- Host: localhost:3306
|
|
-- Generation Time: Dec 01, 2016 at 04:08 PM
|
|
-- Server version: 5.7.16-0ubuntu0.16.10.1
|
|
-- PHP Version: 7.0.8-3ubuntu3
|
|
|
|
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 */;
|
|
|
|
--
|
|
-- Database: `dfs_2016`
|
|
--
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `camps`
|
|
--
|
|
|
|
CREATE TABLE `camps` (
|
|
`id` int(10) UNSIGNED NOT NULL,
|
|
`name` varchar(255) COLLATE utf8_bin NOT NULL,
|
|
`lng` double NOT NULL,
|
|
`lat` double NOT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `categories`
|
|
--
|
|
|
|
CREATE TABLE `categories` (
|
|
`id` int(10) UNSIGNED NOT NULL,
|
|
`name` varchar(255) COLLATE utf8_bin NOT NULL,
|
|
`category_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'The parent category',
|
|
`camp_id` int(10) UNSIGNED NOT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `items`
|
|
--
|
|
|
|
CREATE TABLE `items` (
|
|
`id` int(10) UNSIGNED NOT NULL,
|
|
`name` varchar(100) COLLATE utf8_bin NOT NULL,
|
|
`category_id` int(10) UNSIGNED NOT NULL,
|
|
`description` text COLLATE utf8_bin NOT NULL,
|
|
`hot` int(10) UNSIGNED NOT NULL,
|
|
`cooldown` int(11) NOT NULL COMMENT 'Number of days'
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `needs`
|
|
--
|
|
|
|
CREATE TABLE `needs` (
|
|
`id` int(10) UNSIGNED NOT NULL,
|
|
`user_id` int(10) UNSIGNED NOT NULL COMMENT 'Refugee',
|
|
`item_id` int(10) UNSIGNED NOT NULL,
|
|
`created` date NOT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `offers`
|
|
--
|
|
|
|
CREATE TABLE `offers` (
|
|
`id` int(10) UNSIGNED NOT NULL,
|
|
`user_id` int(10) UNSIGNED NOT NULL COMMENT 'Donor',
|
|
`item_id` int(10) UNSIGNED NOT NULL,
|
|
`created` date NOT NULL,
|
|
`event_date` date NOT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `posts`
|
|
--
|
|
|
|
CREATE TABLE `posts` (
|
|
`id` int(10) UNSIGNED NOT NULL,
|
|
`title` varchar(255) COLLATE utf8_bin NOT NULL,
|
|
`body` text COLLATE utf8_bin NOT NULL,
|
|
`category_id` int(10) UNSIGNED NOT NULL DEFAULT '0'
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `users`
|
|
--
|
|
|
|
CREATE TABLE `users` (
|
|
`id` int(10) UNSIGNED NOT NULL,
|
|
`username` varchar(64) COLLATE utf8_bin NOT NULL,
|
|
`password` varchar(255) COLLATE utf8_bin NOT NULL,
|
|
`role` int(11) NOT NULL COMMENT '0=Orga; 1=Donor; 2=refugee',
|
|
`firstname` varchar(100) COLLATE utf8_bin DEFAULT NULL,
|
|
`name` varchar(100) COLLATE utf8_bin DEFAULT NULL,
|
|
`email` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
|
`phone` varchar(20) COLLATE utf8_bin DEFAULT NULL,
|
|
`description` text COLLATE utf8_bin,
|
|
`created` date DEFAULT NULL,
|
|
`camp_id` int(10) UNSIGNED NOT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
|
|
--
|
|
-- Indexes for dumped tables
|
|
--
|
|
|
|
--
|
|
-- Indexes for table `camps`
|
|
--
|
|
ALTER TABLE `camps`
|
|
ADD PRIMARY KEY (`id`);
|
|
|
|
--
|
|
-- Indexes for table `categories`
|
|
--
|
|
ALTER TABLE `categories`
|
|
ADD PRIMARY KEY (`id`);
|
|
|
|
--
|
|
-- Indexes for table `items`
|
|
--
|
|
ALTER TABLE `items`
|
|
ADD PRIMARY KEY (`id`);
|
|
|
|
--
|
|
-- Indexes for table `needs`
|
|
--
|
|
ALTER TABLE `needs`
|
|
ADD PRIMARY KEY (`id`);
|
|
|
|
--
|
|
-- Indexes for table `offers`
|
|
--
|
|
ALTER TABLE `offers`
|
|
ADD PRIMARY KEY (`id`);
|
|
|
|
--
|
|
-- Indexes for table `posts`
|
|
--
|
|
ALTER TABLE `posts`
|
|
ADD PRIMARY KEY (`id`);
|
|
|
|
--
|
|
-- Indexes for table `users`
|
|
--
|
|
ALTER TABLE `users`
|
|
ADD PRIMARY KEY (`id`);
|
|
|
|
--
|
|
-- AUTO_INCREMENT for dumped tables
|
|
--
|
|
|
|
--
|
|
-- AUTO_INCREMENT for table `camps`
|
|
--
|
|
ALTER TABLE `camps`
|
|
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
|
|
--
|
|
-- AUTO_INCREMENT for table `categories`
|
|
--
|
|
ALTER TABLE `categories`
|
|
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
|
|
--
|
|
-- AUTO_INCREMENT for table `items`
|
|
--
|
|
ALTER TABLE `items`
|
|
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
|
|
--
|
|
-- AUTO_INCREMENT for table `needs`
|
|
--
|
|
ALTER TABLE `needs`
|
|
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
|
|
--
|
|
-- AUTO_INCREMENT for table `offers`
|
|
--
|
|
ALTER TABLE `offers`
|
|
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
|
|
--
|
|
-- AUTO_INCREMENT for table `posts`
|
|
--
|
|
ALTER TABLE `posts`
|
|
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
|
|
--
|
|
-- AUTO_INCREMENT for table `users`
|
|
--
|
|
ALTER TABLE `users`
|
|
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
|
|
/*!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 */;
|