Skip to content

Instantly share code, notes, and snippets.

@zikosw
Created November 6, 2014 14:31
Show Gist options
  • Save zikosw/0dfb6082bd72cd6bf3f1 to your computer and use it in GitHub Desktop.
Save zikosw/0dfb6082bd72cd6bf3f1 to your computer and use it in GitHub Desktop.
leafbox blind lib
CREATE DATABASE IF NOT EXISTS `leafbox` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE `leafbox`;
CREATE TABLE IF NOT EXISTS `book` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isbn` varchar(13) COLLATE utf8_unicode_ci DEFAULT NULL,
`title` text COLLATE utf8_unicode_ci NOT NULL,
`author` text COLLATE utf8_unicode_ci,
`translate` text COLLATE utf8_unicode_ci,
`grade` text COLLATE utf8_unicode_ci,
`bm_status` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`bm_note` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`bm_date` timestamp NULL DEFAULT NULL,
`setcm_status` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`setcm_note` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`setcm_date` timestamp NULL DEFAULT NULL,
`setdm_status` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`setdm_note` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`setdm_date` timestamp NULL DEFAULT NULL,
`setcd_status` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`setcd_note` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`setcd_date` timestamp NULL DEFAULT NULL,
`setdvd_status` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`setdvd_note` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`setdvd_date` timestamp NULL DEFAULT NULL,
`abstract` text COLLATE utf8_unicode_ci NOT NULL,
`book_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`produce_no` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`original_no` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`pub_year` int(11) NOT NULL,
`pub_no` int(11) NOT NULL,
`publisher` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;
CREATE TABLE IF NOT EXISTS `brailie` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`book_id` int(11) NOT NULL,
`numpart` int(11) NOT NULL,
`reserved` text COLLATE utf8_unicode_ci NULL,
`examiner` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`produced` date NOT NULL,
`btype` varchar(50) COLLATE utf8_unicode_ci NULL,
`pages` int(11) NOT NULL,
PRIMARY KEY (`bm_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `brailleborrow` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`member_id` int(11) NOT NULL,
`braill_id` int(11) NOT NULL,
`date_borrowed` datetime NOT NULL,
`date_returned` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `cassette` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`book_id` int(11) NOT NULL,
`numpart` int(11) NOT NULL,
`reserved` text COLLATE utf8_unicode_ci NOT NULL,
`produced_date` date NOT NULL,
`notes` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `cassetteborrow` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`member_id` int(11) NOT NULL,
`cassette_id` int(11) NOT NULL,
`date_borrowed` datetime NOT NULL,
`date_returned` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `cassettedetail` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`cassette_id` int(11) NOT NULL,
`part` int(11) NOT NULL,
`status` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`note` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `cd` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`book_id` int(11) NOT NULL,
`numpart` int(11) NOT NULL,
`reserved` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`produce_date` date NOT NULL,
`notes` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `cdborrow` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`member_id` int(11) NOT NULL,
`setcd_no` varchar(7) COLLATE utf8_unicode_ci NOT NULL,
`date_borrowed` datetime NOT NULL,
`date_returned` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `cddetail` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`cd_id` int(11) NOT NULL,
`part` int(11) NOT NULL,
`status` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`notes` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`track_fr` int(11) NOT NULL,
`track_to` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `daisy` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ibook_no` int(11) NOT NULL,
`numpart` int(11) NOT NULL,
`reserved` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`produced` date NOT NULL,
`notes` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `daisyborrow` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`member_id` int(11) NOT NULL,
`setdm_no` varchar(6) COLLATE utf8_unicode_ci NOT NULL,
`date_borrowed` date NOT NULL,
`date_returned` date NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `daisydetail` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`daisy_id` int(11) NOT NULL,
`part` int(11) NOT NULL,
`status` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`notes` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `dvd` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`book_id` int(11) NOT NULL,
`numpart` int(11) NOT NULL,
`reserved` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`produced_date` date NOT NULL,
`notes` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `dvdborrow` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dvd_id` int(11) NOT NULL,
`member_id` int(11) NOT NULL,
`date_borrowed` datetime NOT NULL,
`date_returned` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `dvddetail` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dvd_id` int(11) NOT NULL,
`part` int(11) NOT NULL,
`status` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`notes` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `member` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`gender` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`address` text COLLATE utf8_unicode_ci NOT NULL,
`district` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`province_postcode` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`member_status` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`phone_no` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
/*!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 */;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment