Skip to content

Instantly share code, notes, and snippets.

@tyluudinh
Last active May 24, 2017 06:40
Show Gist options
  • Save tyluudinh/eca5f73bfa3067ac0066ef29b523f514 to your computer and use it in GitHub Desktop.
Save tyluudinh/eca5f73bfa3067ac0066ef29b523f514 to your computer and use it in GitHub Desktop.
create database music;
use music;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` text COLLATE utf8_unicode_ci,
`username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`fullname` text COLLATE utf8_unicode_ci,
`dob` date DEFAULT NULL,
`avatar` text COLLATE utf8_unicode_ci,
`password` text COLLATE utf8_unicode_ci not null,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created_by` int(11) DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`status` smallint(3) DEFAULT '1',
`is_admin` boolean default false,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `album` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` text COLLATE utf8_unicode_ci not null,
`description` text COLLATE utf8_unicode_ci,
`thumbnail` text COLLATE utf8_unicode_ci,
`album_song_list_id` int(11) default null,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created_by` int(11) DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`status` smallint(3) DEFAULT '1',
`search_text` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `album_song_list` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`album_id` int(11) not null,
`song_id` int(11) not null,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created_by` int(11) DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`status` smallint(3) DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `singer` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` int(11) not null,
`description` text COLLATE utf8_unicode_ci,
`avatar` text COLLATE utf8_unicode_ci,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created_by` int(11) DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`status` smallint(3) DEFAULT '1',
`search_text` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `song_type` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` int(11) not null,
`description` text COLLATE utf8_unicode_ci,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created_by` int(11) DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`status` smallint(3) DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment