Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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` text 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;
- CREATE TABLE `song` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `user_id` int(11) NOT NULL,
- `singer_id` int(11) NOT NULL,
- `artist_id` int(11) NOT NULL,
- `type_id` int(11) NOT NULL,
- `view_num` int(11) DEFAULT 0,
- `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;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement