Skip to content

Instantly share code, notes, and snippets.

@nazt
Created November 5, 2011 15:13
Show Gist options
  • Save nazt/1341644 to your computer and use it in GitHub Desktop.
Save nazt/1341644 to your computer and use it in GitHub Desktop.
openhelp.mysql.sql
-- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 05, 2011 at 03:10 PM
-- Server version: 5.1.44
-- PHP Version: 5.3.1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `grails_dummy`
--
-- --------------------------------------------------------
--
-- Table structure for table `coordinator`
--
CREATE TABLE IF NOT EXISTS `coordinator` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`fullname` varchar(255) NOT NULL,
`pos` varchar(255) NOT NULL,
`tel` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `coordinator`
--
INSERT INTO `coordinator` (`id`, `version`, `fullname`, `pos`, `tel`) VALUES
(1, 0, 'Fufu Dogu', 'CSS', '081888888');
-- --------------------------------------------------------
--
-- Table structure for table `donator`
--
CREATE TABLE IF NOT EXISTS `donator` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`detail` varchar(255) NOT NULL,
`fullname` varchar(255) NOT NULL,
`location_id` bigint(20) NOT NULL,
`tel` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK6D9505193A55BBD` (`location_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `donator`
--
INSERT INTO `donator` (`id`, `version`, `detail`, `fullname`, `location_id`, `tel`) VALUES
(1, 0, 'JaJa', 'Nat Weerawan', 1, '0818526122');
-- --------------------------------------------------------
--
-- Table structure for table `item`
--
CREATE TABLE IF NOT EXISTS `item` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`amount` int(11) NOT NULL,
`donator_id` bigint(20) NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK317B132E3E5C97` (`donator_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `item`
--
INSERT INTO `item` (`id`, `version`, `amount`, `donator_id`, `name`) VALUES
(1, 0, 300, 1, '??????????');
-- --------------------------------------------------------
--
-- Table structure for table `location`
--
CREATE TABLE IF NOT EXISTS `location` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`ampure` varchar(255) NOT NULL,
`lat` varchar(255) NOT NULL,
`lng` varchar(255) NOT NULL,
`province` varchar(255) NOT NULL,
`tumbon` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `location`
--
INSERT INTO `location` (`id`, `version`, `ampure`, `lat`, `lng`, `province`, `tumbon`) VALUES
(1, 0, '?????', '-', '-', '?????????', '??????'),
(2, 0, '?????2', '-', '-', '?????????2', '??????2');
-- --------------------------------------------------------
--
-- Table structure for table `need`
--
CREATE TABLE IF NOT EXISTS `need` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`amount` int(11) NOT NULL,
`items_id` bigint(20) NOT NULL,
`name` varchar(255) NOT NULL,
`shipments_id` bigint(20) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK338896306C40BE` (`shipments_id`),
KEY `FK338896F1D78B0` (`items_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `need`
--
-- --------------------------------------------------------
--
-- Table structure for table `request`
--
CREATE TABLE IF NOT EXISTS `request` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`coordinators_id` bigint(20) NOT NULL,
`date_created` datetime NOT NULL,
`detail` varchar(255) NOT NULL,
`last_updated` datetime NOT NULL,
`location_id` bigint(20) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK414EF28F3A55BBD` (`location_id`),
KEY `FK414EF28F3F39BDC4` (`coordinators_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `request`
--
-- --------------------------------------------------------
--
-- Table structure for table `request_need`
--
CREATE TABLE IF NOT EXISTS `request_need` (
`request_needs_id` bigint(20) DEFAULT NULL,
`need_id` bigint(20) DEFAULT NULL,
KEY `FK4DAB904642CE55B9` (`request_needs_id`),
KEY `FK4DAB904635E72D9D` (`need_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `request_need`
--
-- --------------------------------------------------------
--
-- Table structure for table `shipment`
--
CREATE TABLE IF NOT EXISTS `shipment` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`amount` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`owner_id` bigint(20) NOT NULL,
PRIMARY KEY (`id`),
KEY `FKE139719A1C5222BA` (`owner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `shipment`
--
INSERT INTO `shipment` (`id`, `version`, `amount`, `name`, `owner_id`) VALUES
(1, 0, 300, '??????????', 1);
-- --------------------------------------------------------
--
-- Table structure for table `transporter`
--
CREATE TABLE IF NOT EXISTS `transporter` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`detail` varchar(255) NOT NULL,
`fullname` varchar(255) NOT NULL,
`location_id` bigint(20) NOT NULL,
`tel` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK99E1DD963A55BBD` (`location_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `transporter`
--
INSERT INTO `transporter` (`id`, `version`, `detail`, `fullname`, `location_id`, `tel`) VALUES
(1, 0, 'DETAIL JA', 'Opendream', 1, '1111111');
--
-- Constraints for dumped tables
--
--
-- Constraints for table `donator`
--
ALTER TABLE `donator`
ADD CONSTRAINT `FK6D9505193A55BBD` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`);
--
-- Constraints for table `item`
--
ALTER TABLE `item`
ADD CONSTRAINT `FK317B132E3E5C97` FOREIGN KEY (`donator_id`) REFERENCES `donator` (`id`);
--
-- Constraints for table `need`
--
ALTER TABLE `need`
ADD CONSTRAINT `FK338896F1D78B0` FOREIGN KEY (`items_id`) REFERENCES `item` (`id`),
ADD CONSTRAINT `FK338896306C40BE` FOREIGN KEY (`shipments_id`) REFERENCES `shipment` (`id`);
--
-- Constraints for table `request`
--
ALTER TABLE `request`
ADD CONSTRAINT `FK414EF28F3F39BDC4` FOREIGN KEY (`coordinators_id`) REFERENCES `coordinator` (`id`),
ADD CONSTRAINT `FK414EF28F3A55BBD` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`);
--
-- Constraints for table `request_need`
--
ALTER TABLE `request_need`
ADD CONSTRAINT `FK4DAB904635E72D9D` FOREIGN KEY (`need_id`) REFERENCES `need` (`id`),
ADD CONSTRAINT `FK4DAB904642CE55B9` FOREIGN KEY (`request_needs_id`) REFERENCES `request` (`id`);
--
-- Constraints for table `shipment`
--
ALTER TABLE `shipment`
ADD CONSTRAINT `FKE139719A1C5222BA` FOREIGN KEY (`owner_id`) REFERENCES `transporter` (`id`);
--
-- Constraints for table `transporter`
--
ALTER TABLE `transporter`
ADD CONSTRAINT `FK99E1DD963A55BBD` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment