Advertisement
Guest User

Untitled

a guest
May 24th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. create database music;
  2. use music;
  3. CREATE TABLE `user` (
  4. `id` int(11) NOT NULL AUTO_INCREMENT,
  5. `email` text COLLATE utf8_unicode_ci,
  6. `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  7. `fullname` text COLLATE utf8_unicode_ci,
  8. `dob` date DEFAULT NULL,
  9. `avatar` text COLLATE utf8_unicode_ci,
  10. `password` text COLLATE utf8_unicode_ci not null,
  11. `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  12. `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  13. `created_by` int(11) DEFAULT NULL,
  14. `updated_by` int(11) DEFAULT NULL,
  15. `status` smallint(3) DEFAULT '1',
  16. `is_admin` boolean default false,
  17. PRIMARY KEY (`id`)
  18. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  19.  
  20.  
  21. CREATE TABLE `album` (
  22. `id` int(11) NOT NULL AUTO_INCREMENT,
  23. `name` text COLLATE utf8_unicode_ci not null,
  24. `description` text COLLATE utf8_unicode_ci,
  25. `thumbnail` text COLLATE utf8_unicode_ci,
  26. `album_song_list_id` int(11) default null,
  27. `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  28. `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  29. `created_by` int(11) DEFAULT NULL,
  30. `updated_by` int(11) DEFAULT NULL,
  31. `status` smallint(3) DEFAULT '1',
  32. `search_text` text COLLATE utf8_unicode_ci,
  33. PRIMARY KEY (`id`)
  34. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  35.  
  36. CREATE TABLE `album_song_list` (
  37. `id` int(11) NOT NULL AUTO_INCREMENT,
  38. `album_id` int(11) not null,
  39. `song_id` int(11) not null,
  40. `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  41. `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  42. `created_by` int(11) DEFAULT NULL,
  43. `updated_by` int(11) DEFAULT NULL,
  44. `status` smallint(3) DEFAULT '1',
  45. PRIMARY KEY (`id`)
  46. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  47.  
  48.  
  49. CREATE TABLE `singer` (
  50. `id` int(11) NOT NULL AUTO_INCREMENT,
  51. `name` text not null,
  52. `description` text COLLATE utf8_unicode_ci,
  53. `avatar` text COLLATE utf8_unicode_ci,
  54. `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  55. `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  56. `created_by` int(11) DEFAULT NULL,
  57. `updated_by` int(11) DEFAULT NULL,
  58. `status` smallint(3) DEFAULT '1',
  59. `search_text` text COLLATE utf8_unicode_ci,
  60. PRIMARY KEY (`id`)
  61. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  62.  
  63. CREATE TABLE `song_type` (
  64. `id` int(11) NOT NULL AUTO_INCREMENT,
  65. `name` int(11) not null,
  66. `description` text COLLATE utf8_unicode_ci,
  67. `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  68. `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  69. `created_by` int(11) DEFAULT NULL,
  70. `updated_by` int(11) DEFAULT NULL,
  71. `status` smallint(3) DEFAULT '1',
  72. PRIMARY KEY (`id`)
  73. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  74.  
  75. CREATE TABLE `song` (
  76. `id` int(11) NOT NULL AUTO_INCREMENT,
  77. `user_id` int(11) NOT NULL,
  78. `singer_id` int(11) NOT NULL,
  79. `artist_id` int(11) NOT NULL,
  80. `type_id` int(11) NOT NULL,
  81. `view_num` int(11) DEFAULT 0,
  82. `description` text COLLATE utf8_unicode_ci,
  83. `avatar` text COLLATE utf8_unicode_ci,
  84. `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  85. `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  86. `created_by` int(11) DEFAULT NULL,
  87. `updated_by` int(11) DEFAULT NULL,
  88. `status` smallint(3) DEFAULT '1',
  89. `search_text` text COLLATE utf8_unicode_ci,
  90. PRIMARY KEY (`id`)
  91. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement