Skip to content

Instantly share code, notes, and snippets.

@twmbx
Created May 31, 2017 10:30
Show Gist options
  • Save twmbx/3c50ec3a20b9fc8ef720466f1036cf40 to your computer and use it in GitHub Desktop.
Save twmbx/3c50ec3a20b9fc8ef720466f1036cf40 to your computer and use it in GitHub Desktop.

Revisions

  1. twmbx created this gist May 31, 2017.
    182 changes: 182 additions & 0 deletions database.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,182 @@
    -- MySQL dump 10.15 Distrib 10.0.29-MariaDB, for debian-linux-gnu (x86_64)
    --
    -- Host: localhost Database: localhost
    -- ------------------------------------------------------
    -- Server version 10.0.29-MariaDB-0ubuntu0.16.04.1

    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8mb4 */;
    /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
    /*!40103 SET TIME_ZONE='+00:00' */;
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

    --
    -- Table structure for table `artists`
    --

    DROP TABLE IF EXISTS `artists`;
    /*!40101 SET @saved_cs_client = @@character_set_client */;
    /*!40101 SET character_set_client = utf8 */;
    CREATE TABLE `artists` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `moniker` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `website` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `twitter` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `facebook` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `instagram` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `birthday` date NOT NULL,
    `photo` int(11) DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
    /*!40101 SET character_set_client = @saved_cs_client */;

    --
    -- Dumping data for table `artists`
    --

    LOCK TABLES `artists` WRITE;
    /*!40000 ALTER TABLE `artists` DISABLE KEYS */;
    /*!40000 ALTER TABLE `artists` ENABLE KEYS */;
    UNLOCK TABLES;

    --
    -- Table structure for table `artist_releases`
    --

    DROP TABLE IF EXISTS `artist_releases`;
    /*!40101 SET @saved_cs_client = @@character_set_client */;
    /*!40101 SET character_set_client = utf8 */;
    CREATE TABLE `artist_releases` (
    `id` int(11) NOT NULL,
    `artist_id` int(10) unsigned NOT NULL,
    `release_id` int(11) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `artist_releases_artist_id_foreign` (`artist_id`),
    KEY `artist_releases_release_id_foreign` (`release_id`),
    CONSTRAINT `artist_releases_artist_id_foreign` FOREIGN KEY (`artist_id`) REFERENCES `artists` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT `artist_releases_release_id_foreign` FOREIGN KEY (`release_id`) REFERENCES `releases` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
    /*!40101 SET character_set_client = @saved_cs_client */;

    --
    -- Dumping data for table `artist_releases`
    --

    LOCK TABLES `artist_releases` WRITE;
    /*!40000 ALTER TABLE `artist_releases` DISABLE KEYS */;
    /*!40000 ALTER TABLE `artist_releases` ENABLE KEYS */;
    UNLOCK TABLES;

    --
    -- Table structure for table `releases`
    --

    DROP TABLE IF EXISTS `releases`;
    /*!40101 SET @saved_cs_client = @@character_set_client */;
    /*!40101 SET character_set_client = utf8 */;
    CREATE TABLE `releases` (
    `id` int(11) NOT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `release_date` date NOT NULL,
    `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'album',
    `mvesesani_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `released` tinyint(1) NOT NULL DEFAULT '0',
    `artwork_cover` int(11) DEFAULT NULL,
    `artwork_tracklist` int(11) DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
    /*!40101 SET character_set_client = @saved_cs_client */;

    --
    -- Dumping data for table `releases`
    --

    LOCK TABLES `releases` WRITE;
    /*!40000 ALTER TABLE `releases` DISABLE KEYS */;
    /*!40000 ALTER TABLE `releases` ENABLE KEYS */;
    UNLOCK TABLES;

    --
    -- Table structure for table `rightsholder_releases`
    --

    DROP TABLE IF EXISTS `rightsholder_releases`;
    /*!40101 SET @saved_cs_client = @@character_set_client */;
    /*!40101 SET character_set_client = utf8 */;
    CREATE TABLE `rightsholder_releases` (
    `id` int(11) NOT NULL,
    `rightsholder_id` int(10) unsigned NOT NULL,
    `release_id` int(11) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `rightsholder_releases_rightsholder_id_foreign` (`rightsholder_id`),
    KEY `rightsholder_releases_release_id_foreign` (`release_id`),
    CONSTRAINT `rightsholder_releases_release_id_foreign` FOREIGN KEY (`release_id`) REFERENCES `releases` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT `rightsholder_releases_rightsholder_id_foreign` FOREIGN KEY (`rightsholder_id`) REFERENCES `rightsholders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
    /*!40101 SET character_set_client = @saved_cs_client */;

    --
    -- Dumping data for table `rightsholder_releases`
    --

    LOCK TABLES `rightsholder_releases` WRITE;
    /*!40000 ALTER TABLE `rightsholder_releases` DISABLE KEYS */;
    /*!40000 ALTER TABLE `rightsholder_releases` ENABLE KEYS */;
    UNLOCK TABLES;

    --
    -- Table structure for table `rightsholders`
    --

    DROP TABLE IF EXISTS `rightsholders`;
    /*!40101 SET @saved_cs_client = @@character_set_client */;
    /*!40101 SET character_set_client = utf8 */;
    CREATE TABLE `rightsholders` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `artist_id` int(10) unsigned DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `rightsholders_artist_id_foreign` (`artist_id`),
    CONSTRAINT `rightsholders_artist_id_foreign` FOREIGN KEY (`artist_id`) REFERENCES `artists` (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
    /*!40101 SET character_set_client = @saved_cs_client */;

    --
    -- Dumping data for table `rightsholders`
    --

    LOCK TABLES `rightsholders` WRITE;
    /*!40000 ALTER TABLE `rightsholders` DISABLE KEYS */;
    /*!40000 ALTER TABLE `rightsholders` ENABLE KEYS */;
    UNLOCK TABLES;
    /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

    /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
    /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
    /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
    /*!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 */;
    /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

    -- Dump completed on 2017-05-31 12:28:57