Initital scan and signalr work

This commit is contained in:
Steven Hildreth 2018-12-13 21:52:14 -06:00
parent 603fca18c4
commit e03f01ecb1
12 changed files with 1316 additions and 9 deletions

View file

@ -9,6 +9,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Roadie.Library", "RoadieLib
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Roadie.Library.Tests", "Roadie.Library.Tests\Roadie.Library.Tests.csproj", "{52E58F4B-88F0-4336-AD06-1184E857FA2C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{1BA7115B-6E37-4546-BBD6-C8B0787A3FE0}"
ProjectSection(SolutionItems) = preProject
new_setup.sql = new_setup.sql
roadie.sql = roadie.sql
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU

View file

@ -0,0 +1,54 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Roadie.Api.Services;
using Roadie.Library.Caching;
using Roadie.Library.Identity;
using Roadie.Library.Models.Pagination;
using System;
using System.Net;
using System.Threading.Tasks;
using models = Roadie.Library.Models;
namespace Roadie.Api.Controllers
{
[Route("admin")]
[ApiController]
[Authorize("Editor")]
public class AdminController : EntityControllerBase
{
private IAdminService AdminService { get; }
public AdminController(IAdminService adminService, ILoggerFactory logger, ICacheManager cacheManager, IConfiguration configuration, UserManager<ApplicationUser> userManager)
: base(cacheManager, configuration, userManager)
{
this.Logger = logger.CreateLogger("RoadieApi.Controllers.AdminController");
this.AdminService = adminService;
}
[HttpGet("scan")]
[ProducesResponseType(200)]
[Authorize("Admin")]
public async Task<IActionResult> Scan()
{
var result = await this.AdminService.ScanInboundFolder(await this.UserManager.GetUserAsync(User));
if (!result.IsSuccess)
{
return StatusCode((int)HttpStatusCode.InternalServerError);
}
return Ok(result);
}
[HttpPost("{id}")]
[ProducesResponseType(200)]
public async Task<IActionResult> ScanArtist(Guid id)
{
throw new NotImplementedException();
}
}
}

View file

@ -0,0 +1,17 @@
using Microsoft.AspNetCore.SignalR;
using Roadie.Library.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Roadie.Api.Hubs
{
public class ScanActivityHub : Hub
{
public async Task SendSystemActivity(string scanActivity)
{
await Clients.All.SendAsync("SendSystemActivity", scanActivity);
}
}
}

View file

@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<Platforms>AnyCPU;x64</Platforms>
<UserSecretsId>3f484b72-52aa-42ae-938d-4635f9511319</UserSecretsId>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View file

@ -0,0 +1,104 @@
using Mapster;
using Microsoft.AspNetCore.SignalR;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Roadie.Api.Hubs;
using Roadie.Library;
using Roadie.Library.Caching;
using Roadie.Library.Configuration;
using Roadie.Library.Encoding;
using Roadie.Library.Enums;
using Roadie.Library.Extensions;
using Roadie.Library.Identity;
using Roadie.Library.Models;
using Roadie.Library.Models.Pagination;
using Roadie.Library.Models.Releases;
using Roadie.Library.Models.Statistics;
using Roadie.Library.Models.Users;
using Roadie.Library.Processors;
using Roadie.Library.Utility;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
using data = Roadie.Library.Data;
namespace Roadie.Api.Services
{
public class AdminService : ServiceBase, IAdminService
{
protected IHubContext<ScanActivityHub> ScanActivityHub { get; }
public AdminService(IRoadieSettings configuration,
IHttpEncoder httpEncoder,
IHttpContext httpContext,
data.IRoadieDbContext context,
ICacheManager cacheManager,
ILogger<ArtistService> logger,
IHubContext<ScanActivityHub> scanActivityHub
)
: base(configuration, httpEncoder, context, cacheManager, logger, httpContext)
{
this.ScanActivityHub = scanActivityHub;
}
public async Task<OperationResult<bool>> ScanInboundFolder(ApplicationUser user, bool isReadOnly = false)
{
var d = new DirectoryInfo(this.Configuration.InboundFolder);
var dest = new DirectoryInfo(this.Configuration.LibraryFolder);
var sw = new Stopwatch();
sw.Start();
long processedFiles = 0;
await this.LogAndPublish($"** Processing Folder: [{d.FullName}]");
long processedFolders = 0;
var folderProcessor = new FolderProcessor(this.Configuration, this.HttpEncoder, this.Configuration.LibraryFolder, this.DbContext, this.CacheManager, this.Logger);
foreach (var folder in Directory.EnumerateDirectories(d.FullName).ToArray())
{
await folderProcessor.Process(new DirectoryInfo(folder), isReadOnly);
processedFolders++;
}
if (!isReadOnly)
{
folderProcessor.DeleteEmptyFolders(d);
}
sw.Stop();
await this.LogAndPublish($"**Completed!Processed Folders[{ processedFolders }], Processed Files[{ processedFiles}] : Elapsed Time[{ sw.Elapsed}]");
return new OperationResult<bool>
{
Data = true,
IsSuccess = true,
OperationTime = sw.ElapsedMilliseconds
};
}
private async Task LogAndPublish(string message, LogLevel level = LogLevel.Trace)
{
switch (level)
{
case LogLevel.Trace:
this.Logger.LogTrace(message);
break;
case LogLevel.Debug:
this.Logger.LogDebug(message);
break;
case LogLevel.Information:
this.Logger.LogInformation(message);
break;
case LogLevel.Warning:
this.Logger.LogWarning(message);
break;
case LogLevel.Critical:
this.Logger.LogCritical(message);
break;
}
await this.ScanActivityHub.Clients.All.SendAsync("SendSystemActivity", message);
}
}
}

View file

@ -0,0 +1,14 @@
using Roadie.Library;
using Roadie.Library.Identity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Roadie.Api.Services
{
public interface IAdminService
{
Task<OperationResult<bool>> ScanInboundFolder(ApplicationUser user, bool isReadOnly = false);
}
}

View file

@ -202,7 +202,7 @@ namespace Roadie.Api.Services
{
try
{
await this.PlayActivityHub.Clients.All.SendAsync(JsonConvert.SerializeObject(pl));
await this.PlayActivityHub.Clients.All.SendAsync("SendActivity",pl);
}
catch (Exception ex)
{

View file

@ -690,6 +690,7 @@ namespace Roadie.Api.Services
Text = track.Title,
Value = track.RoadieId.ToString()
};
t.CssClass = string.IsNullOrEmpty(track.Hash) ? "Missing" : "Ok";
t.TrackArtist = track.TrackArtist != null ? ArtistList.FromDataArtist(track.TrackArtist, this.MakeArtistThumbnailImage(track.TrackArtist.RoadieId)) : null;
t.TrackPlayUrl = $"{ this.HttpContext.BaseUrl }/play/track/{ t.Id}.mp3";
rmTracks.Add(t);

View file

@ -42,6 +42,8 @@ namespace Roadie.Api
this._configuration = configuration;
this._loggerFactory = loggerFactory;
TypeAdapterConfig<Roadie.Library.Data.Image, Roadie.Library.Models.Image>
.NewConfig()
.Map(i => i.ArtistId,
@ -77,6 +79,7 @@ namespace Roadie.Api
app.UseSignalR(routes =>
{
routes.MapHub<PlayActivityHub>("/playActivityHub");
routes.MapHub<ScanActivityHub>("/scanActivityHub");
});
app.UseMvc();
}
@ -123,7 +126,7 @@ namespace Roadie.Api
services.AddAuthorization(options =>
{
options.AddPolicy("Admin", policy => policy.RequireRole("Admin"));
options.AddPolicy("Editor", policy => policy.RequireRole("Editor"));
options.AddPolicy("Editor", policy => policy.RequireRole("Admin", "Editor"));
});
services.Configure<IConfiguration>(this._configuration);
@ -136,6 +139,30 @@ namespace Roadie.Api
var hostingEnvironment = ctx.GetService<IHostingEnvironment>();
settings.ContentPath = hostingEnvironment.WebRootPath;
settings.ConnectionString = this._configuration.GetConnectionString("RoadieDatabaseConnection");
var integrationKeys = this._configuration.GetSection("IntegrationKeys")
.Get<IntegrationKey>();
settings.Integrations.ApiKeys = new System.Collections.Generic.List<ApiKey>
{
new ApiKey
{
ApiName = "LastFMApiKey",
Key = integrationKeys.LastFMApiKey,
KeySecret = integrationKeys.LastFMSecret
},
new ApiKey
{
ApiName = "DiscogsConsumerKey",
Key = integrationKeys.DiscogsConsumerKey,
KeySecret = integrationKeys.DiscogsConsumerSecret
},
new ApiKey
{
ApiName = "BingImageSearch",
Key = integrationKeys.BingImageSearch
}
};
return settings;
});
services.AddSingleton<IActionContextAccessor, ActionContextAccessor>();
@ -154,6 +181,7 @@ namespace Roadie.Api
services.AddScoped<IGenreService, GenreService>();
services.AddScoped<ISubsonicService, SubsonicService>();
services.AddScoped<IUserService, UserService>();
services.AddScoped<IAdminService, AdminService>();
var securityKey = new SymmetricSecurityKey(System.Text.Encoding.Default.GetBytes(this._configuration["Tokens:PrivateKey"]));
@ -211,5 +239,15 @@ namespace Roadie.Api
});
}
private class IntegrationKey
{
public string BingImageSearch { get; set; }
public string LastFMApiKey { get; set; }
public string LastFMSecret { get; set; }
public string DiscogsConsumerKey { get; set; }
public string DiscogsConsumerSecret { get; set; }
}
}
}

View file

@ -1,10 +1,136 @@
{
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
"Kestrel": {
"EndPoints": {
"Http": {
"Url": "http://192.168.1.177:5123/"
}
}
},
"Serilog": {
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.RollingFileAlternate" ],
"MinimumLevel": {
"Default": "Verbose",
"Override": {
"System": "Warning",
"Microsoft.AspNetCore": "Warning",
"Microsoft.EntityFrameworkCore": "Information"
}
},
"WriteTo": [
{
"Name": "Console",
"Args": {
"theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console",
"restrictedToMinimumLevel": "Verbose"
}
},
{
"Name": "RollingFileAlternate",
"Args": {
"restrictedToMinimumLevel": "Warning",
"path": "{Date}.log",
"logDirectory": "logs",
"fileSizeLimitBytes": 26214400,
"buffered": true
}
}
],
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId", "WithExceptionDetails" ],
"Properties": {
"Application": "Roadie API"
}
},
"Tokens": {
"PrivateKey": "!1232bcdb4bebc80a0d080883d6deefuxlsh8bfc920c2a8cskeuxd8349sk412aa785662e594b4df48cb46aa3c652b40b3#",
"PublicKey": "91i4874y24134E50sz7dges68AB08",
"Lifetime": "86400",
"Issuer": "http://localhost:5123",
"Audience": "http://localhost:5500"
},
"ConnectionStrings": {
"RoadieDatabaseConnection": "server=voyager;userid=roadie;password=MenAtW0rk668;persistsecurityinfo=True;database=roadie_dev;ConvertZeroDateTime=true"
},
"RoadieSettings": {
"SiteName": "Roadie",
"DefaultTimeZone": "US/Central",
"DiagnosticsPassword": "RoadieDiagPassword",
"InboundFolder": "C:\\roadie_dev_root\\inbound",
"LibraryFolder": "C:\\\\roadie_dev_root\\\\library",
"Thumbnails": {
"Height": 80,
"Width": 80
},
"MediumThumbnails": {
"Height": 160,
"Width": 160
},
"LargeThumbnails": {
"Height": 320,
"Width": 320
},
"DontDoMetaDataProvidersSearchArtists": [ "Various Artists", "Sound Tracks" ],
"FileExtenionsToDelete": [ ".cue", ".db", ".gif", ".html", ".ini", ".jpg", ".jpeg", ".log", ".mpg", ".m3u", ".png", ".nfo", ".nzb", ".sfv", ".srr", ".txt", ".url" ],
"RecordNoResultSearches": true,
"SingleArtistHoldingFolder": "C:\\roadie_dev_root\\single_holding",
"ArtistNameReplace": {
"AC/DC": [ "AC; DC", "AC;DC", "AC/ DC", "AC DC" ],
"Love/Hate": [ "Love; Hate", "Love;Hate", "Love/ Hate", "Love Hate" ]
},
"Integrations": {
"ITunesProviderEnabled": true,
"MusicBrainzProviderEnabled": true,
"SpotifyProviderEnabled": true
},
"Processing": {
"DoAudioCleanup": true,
"DoSaveEditsToTags": true,
"DoClearComments": true,
"DoParseFromFileName": true,
"DoParseFromDiscogsDBFindingTrackForArtist": true,
"DoParseFromDiscogsDB": true,
"DoParseFromMusicBrainz": true,
"DoParseFromLastFM": true,
"MaximumArtistImagesToAdd": 12,
"MaximumReleaseImagesToAdd": 12,
"MaxImageWidth": 800,
"RemoveStringsRegex": "\\b[0-9]+\\s#\\s\\b",
"ReplaceStrings": [
{
"order": 1,
"key": "-OBSERVER",
"replaceWith": ""
},
{
"order": 2,
"key": "[Torrent Tatty]",
"replaceWith": ""
},
{
"order": 3,
"key": "_",
"replaceWith": ""
},
{
"order": 4,
"key": "-",
"replaceWith": ""
},
{
"order": 5,
"key": "~",
"replaceWith": ""
},
{
"order": 6,
"key": "^",
"replaceWith": ""
},
{
"order": 7,
"key": "#",
"replaceWith": ""
}
]
}
}
}
}

6
new_setup.sql Normal file
View file

@ -0,0 +1,6 @@
DELETE FROM `userrole`;
INSERT INTO `userrole` (isLocked,status,roadieId,createdDate,lastUpdated,name,description,ConcurrencyStamp,NormalizedName) VALUES
(1,1,'0f3ff165-7b4a-468d-b6ea-35180d8afc4b',UTC_DATE(),NULL,'Admin','Users with Administrative (full) access','0d325432-9bc9-4329-bc49-e07c7eccadf4','ADMIN')
,(1,1,'c2443173-8653-4c86-ae74-92799380c5eb',UTC_DATE(),NULL,'Editor','Users who have Edit Permissions','0d325432-9bc9-4329-bc49-e07c7eccadf4','EDITOR')
;

940
roadie.sql Normal file
View file

@ -0,0 +1,940 @@
-- MySQL dump 10.14 Distrib 5.5.60-MariaDB, for Linux (x86_64)
--
-- Host: localhost Database: roadie
-- ------------------------------------------------------
-- Server version 5.5.60-MariaDB
/*!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 utf8 */;
/*!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 `artist`
--
DROP TABLE IF EXISTS `artist`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `artist` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`name` varchar(250) NOT NULL,
`sortName` varchar(250) DEFAULT NULL,
`rating` smallint(6) NOT NULL,
`realName` varchar(500) DEFAULT NULL,
`musicBrainzId` varchar(100) DEFAULT NULL,
`iTunesId` varchar(100) DEFAULT NULL,
`amgId` varchar(100) DEFAULT NULL,
`spotifyId` varchar(100) DEFAULT NULL,
`thumbnail` blob,
`profile` text,
`birthDate` date DEFAULT NULL,
`beginDate` date DEFAULT NULL,
`endDate` date DEFAULT NULL,
`artistType` enum('Person','Group','Orchestra','Choir','Character','Other') DEFAULT NULL,
`bioContext` text,
`bandStatus` enum('Active','On Hold','Split Up') DEFAULT NULL,
`discogsId` varchar(50) DEFAULT NULL,
`tags` text,
`alternateNames` text,
`urls` text,
`isniList` text,
`releaseCount` int(11) DEFAULT NULL,
`trackCount` int(11) DEFAULT NULL,
`playedCount` int(11) DEFAULT NULL,
`lastPlayed` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ix_artist_name` (`name`),
UNIQUE KEY `ix_artist_sortname` (`sortName`),
KEY `ix_artist_roadieId` (`roadieId`)
) ENGINE=InnoDB AUTO_INCREMENT=35855 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `artistAssociation`
--
DROP TABLE IF EXISTS `artistAssociation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `artistAssociation` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`artistId` int(11) NOT NULL,
`associatedArtistId` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `associatedArtistId` (`associatedArtistId`),
KEY `idx_artistAssociation` (`artistId`,`associatedArtistId`),
CONSTRAINT `artistAssociation_ibfk_1` FOREIGN KEY (`artistId`) REFERENCES `artist` (`id`) ON DELETE CASCADE,
CONSTRAINT `artistAssociation_ibfk_2` FOREIGN KEY (`associatedArtistId`) REFERENCES `artist` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=181 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `artistGenreTable`
--
DROP TABLE IF EXISTS `artistGenreTable`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `artistGenreTable` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`artistId` int(11) DEFAULT NULL,
`genreId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `genreId` (`genreId`),
KEY `idx_artistGenreAssociation` (`artistId`,`genreId`),
KEY `ix_artistGenreTable_artistId` (`artistId`),
CONSTRAINT `artistGenreTable_ibfk_1` FOREIGN KEY (`artistId`) REFERENCES `artist` (`id`) ON DELETE CASCADE,
CONSTRAINT `artistGenreTable_ibfk_2` FOREIGN KEY (`genreId`) REFERENCES `genre` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=30900 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `bookmark`
--
DROP TABLE IF EXISTS `bookmark`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bookmark` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`userId` int(11) DEFAULT NULL,
`bookmarkType` smallint(6) DEFAULT NULL,
`bookmarkTargetId` int(11) DEFAULT NULL,
`isLocked` tinyint(1) DEFAULT NULL,
`position` int(11) DEFAULT NULL,
`comment` varchar(4000) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `bookmark_bookmarkType_IDX` (`bookmarkType`,`bookmarkTargetId`,`userId`) USING BTREE,
KEY `ix_bookmark_roadieId` (`roadieId`),
KEY `ix_bookmark_userId` (`userId`),
CONSTRAINT `bookmark_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=588 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `chatMessage`
--
DROP TABLE IF EXISTS `chatMessage`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `chatMessage` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`userId` int(11) NOT NULL,
`message` varchar(5000) NOT NULL,
PRIMARY KEY (`id`),
KEY `idx_user` (`userId`),
CONSTRAINT `chatMessage_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=82 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `collection`
--
DROP TABLE IF EXISTS `collection`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `collection` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`name` varchar(100) NOT NULL,
`sortName` varchar(100) DEFAULT NULL,
`edition` varchar(200) DEFAULT NULL,
`listInCSVFormat` varchar(200) DEFAULT NULL,
`listInCSV` text,
`description` varchar(1000) DEFAULT NULL,
`thumbnail` blob,
`urls` text,
`maintainerId` int(11) DEFAULT NULL,
`collectionType` enum('Collection','Chart','Rank','Unknown') DEFAULT NULL,
`collectionCount` int(11) DEFAULT NULL,
`tags` text,
`alternateNames` text,
PRIMARY KEY (`id`),
UNIQUE KEY `ix_collection_name` (`name`),
KEY `maintainerId` (`maintainerId`),
KEY `ix_collection_roadieId` (`roadieId`),
CONSTRAINT `collection_ibfk_1` FOREIGN KEY (`maintainerId`) REFERENCES `user` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=92 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `collectionrelease`
--
DROP TABLE IF EXISTS `collectionrelease`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `collectionrelease` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`listNumber` int(11) NOT NULL,
`releaseId` int(11) DEFAULT NULL,
`collectionId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `releaseId` (`releaseId`),
KEY `idx_collection_release` (`collectionId`,`releaseId`),
KEY `ix_collectionrelease_roadieId` (`roadieId`),
CONSTRAINT `collectionrelease_ibfk_1` FOREIGN KEY (`releaseId`) REFERENCES `release` (`id`) ON DELETE CASCADE,
CONSTRAINT `collectionrelease_ibfk_2` FOREIGN KEY (`collectionId`) REFERENCES `collection` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=48191 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `genre`
--
DROP TABLE IF EXISTS `genre`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `genre` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`name` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ix_genre_name` (`name`),
KEY `ix_genre_roadieId` (`roadieId`)
) ENGINE=InnoDB AUTO_INCREMENT=1912 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `image`
--
DROP TABLE IF EXISTS `image`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `image` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`image` mediumblob,
`url` varchar(500) DEFAULT NULL,
`caption` varchar(100) DEFAULT NULL,
`signature` varchar(50) DEFAULT NULL,
`artistId` int(11) DEFAULT NULL,
`releaseId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `ix_image_releaseId` (`releaseId`),
KEY `ix_image_roadieId` (`roadieId`),
KEY `ix_image_artistId` (`artistId`),
CONSTRAINT `image_ibfk_1` FOREIGN KEY (`artistId`) REFERENCES `artist` (`id`) ON DELETE CASCADE,
CONSTRAINT `image_ibfk_2` FOREIGN KEY (`releaseId`) REFERENCES `release` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=77949 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `label`
--
DROP TABLE IF EXISTS `label`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `label` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`name` varchar(250) NOT NULL,
`sortName` varchar(500) DEFAULT NULL,
`musicBrainzId` varchar(100) DEFAULT NULL,
`beginDate` date DEFAULT NULL,
`endDate` date DEFAULT NULL,
`imageUrl` varchar(500) DEFAULT NULL,
`tags` text,
`alternateNames` text,
`urls` text,
`thumbnail` blob,
`profile` text,
`discogsId` varchar(50) DEFAULT NULL,
`artistCount` int(11) DEFAULT NULL,
`releaseCount` int(11) DEFAULT NULL,
`trackCount` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ix_label_name` (`name`),
KEY `ix_label_roadieId` (`roadieId`)
) ENGINE=InnoDB AUTO_INCREMENT=2291 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `playlist`
--
DROP TABLE IF EXISTS `playlist`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `playlist` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`isPublic` tinyint(1) DEFAULT NULL,
`name` varchar(100) NOT NULL,
`description` varchar(1000) DEFAULT NULL,
`thumbnail` blob,
`urls` text,
`tags` text,
`userId` int(11) DEFAULT NULL,
`alternateNames` text,
`trackCount` smallint(6) DEFAULT NULL,
`duration` int(11) DEFAULT NULL,
`releaseCount` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ix_playlist_name` (`name`,`userId`),
KEY `ix_playlist_roadieId` (`roadieId`),
KEY `ix_playlist_userId` (`userId`),
CONSTRAINT `playlist_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `playlisttrack`
--
DROP TABLE IF EXISTS `playlisttrack`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `playlisttrack` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`listNumber` int(11) NOT NULL,
`trackId` int(11) DEFAULT NULL,
`playListId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `trackId` (`trackId`),
KEY `playListId` (`playListId`),
KEY `ix_playlisttrack_roadieId` (`roadieId`),
CONSTRAINT `playlisttrack_ibfk_1` FOREIGN KEY (`trackId`) REFERENCES `track` (`id`) ON DELETE CASCADE,
CONSTRAINT `playlisttrack_ibfk_2` FOREIGN KEY (`playListId`) REFERENCES `playlist` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1060 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `release`
--
DROP TABLE IF EXISTS `release`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `release` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`submissionId` int(11) DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`isVirtual` tinyint(1) DEFAULT NULL,
`title` varchar(250) NOT NULL,
`alternateNames` text,
`releaseDate` date DEFAULT NULL,
`rating` smallint(6) NOT NULL,
`trackCount` smallint(6) NOT NULL,
`mediaCount` smallint(6) DEFAULT NULL,
`thumbnail` blob,
`profile` text,
`discogsId` varchar(50) DEFAULT NULL,
`releaseType` enum('Release','EP','Single','Unknown') DEFAULT NULL,
`libraryStatus` enum('Complete','Incomplete','Missing','Wishlist') DEFAULT NULL,
`iTunesId` varchar(100) DEFAULT NULL,
`amgId` varchar(100) DEFAULT NULL,
`lastFMId` varchar(100) DEFAULT NULL,
`lastFMSummary` text,
`musicBrainzId` varchar(100) DEFAULT NULL,
`spotifyId` varchar(100) DEFAULT NULL,
`tags` text,
`urls` text,
`artistId` int(11) DEFAULT NULL,
`lastPlayed` datetime DEFAULT NULL,
`playedCount` int(11) DEFAULT NULL,
`duration` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_releaseArtistAndTitle` (`artistId`,`title`),
KEY `ix_release_roadieId` (`roadieId`),
KEY `ix_release_title` (`title`),
CONSTRAINT `release_ibfk_1` FOREIGN KEY (`artistId`) REFERENCES `artist` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=26476 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `releaseGenreTable`
--
DROP TABLE IF EXISTS `releaseGenreTable`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `releaseGenreTable` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`releaseId` int(11) DEFAULT NULL,
`genreId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `genreId` (`genreId`),
KEY `idx_releaseGenreTableReleaseAndGenre` (`releaseId`,`genreId`),
CONSTRAINT `releaseGenreTable_ibfk_1` FOREIGN KEY (`releaseId`) REFERENCES `release` (`id`) ON DELETE CASCADE,
CONSTRAINT `releaseGenreTable_ibfk_2` FOREIGN KEY (`genreId`) REFERENCES `genre` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=29802 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `releaselabel`
--
DROP TABLE IF EXISTS `releaselabel`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `releaselabel` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`catalogNumber` varchar(200) DEFAULT NULL,
`beginDate` date DEFAULT NULL,
`endDate` date DEFAULT NULL,
`releaseId` int(11) DEFAULT NULL,
`labelId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `labelId` (`labelId`),
KEY `idx_release_label` (`releaseId`,`labelId`),
KEY `ix_releaselabel_roadieId` (`roadieId`),
CONSTRAINT `releaselabel_ibfk_1` FOREIGN KEY (`releaseId`) REFERENCES `release` (`id`) ON DELETE CASCADE,
CONSTRAINT `releaselabel_ibfk_2` FOREIGN KEY (`labelId`) REFERENCES `label` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9374 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `releasemedia`
--
DROP TABLE IF EXISTS `releasemedia`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `releasemedia` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`releaseMediaNumber` smallint(6) DEFAULT NULL,
`releaseSubTitle` varchar(500) DEFAULT NULL,
`trackCount` smallint(6) NOT NULL,
`releaseId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `ix_releasemedia_roadieId` (`roadieId`),
KEY `releasemedia_releaseId_IDX` (`releaseId`,`releaseMediaNumber`) USING BTREE,
CONSTRAINT `releasemedia_ibfk_1` FOREIGN KEY (`releaseId`) REFERENCES `release` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=24953 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `request`
--
DROP TABLE IF EXISTS `request`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `request` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`userId` int(11) DEFAULT NULL,
`description` varchar(500) NOT NULL,
PRIMARY KEY (`id`),
KEY `ix_request_roadieId` (`roadieId`),
KEY `requestartist_ibfk_1` (`userId`),
CONSTRAINT `requestartist_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1028 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `scanHistory`
--
DROP TABLE IF EXISTS `scanHistory`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `scanHistory` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`userId` int(11) NOT NULL,
`forArtistId` int(11) DEFAULT NULL,
`forReleaseId` int(11) DEFAULT NULL,
`newArtists` int(11) DEFAULT NULL,
`newReleases` int(11) DEFAULT NULL,
`newTracks` int(11) DEFAULT NULL,
`timeSpanInSeconds` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `ix_scanHistory_roadieId` (`roadieId`),
KEY `rscanHistoryt_ibfk_1` (`userId`),
CONSTRAINT `scanHistory_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=1026 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `submission`
--
DROP TABLE IF EXISTS `submission`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `submission` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`userId` int(11) DEFAULT NULL,
`IsLocked` bit(1) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `ix_submission_roadieId` (`roadieId`),
KEY `submission_ibfk_1` (`userId`),
CONSTRAINT `submission_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `track`
--
DROP TABLE IF EXISTS `track`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `track` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`filePath` varchar(1000) DEFAULT NULL,
`fileName` varchar(500) DEFAULT NULL,
`fileSize` int(11) DEFAULT NULL,
`hash` varchar(32) DEFAULT NULL,
`playedCount` int(11) DEFAULT NULL,
`lastPlayed` datetime DEFAULT NULL,
`partTitles` text,
`rating` smallint(6) NOT NULL,
`musicBrainzId` varchar(100) DEFAULT NULL,
`lastFMId` varchar(50) DEFAULT NULL,
`amgId` varchar(100) DEFAULT NULL,
`spotifyId` varchar(100) DEFAULT NULL,
`title` varchar(250) NOT NULL,
`alternateNames` text,
`trackNumber` smallint(6) NOT NULL,
`duration` int(11) DEFAULT NULL,
`tags` text,
`releaseMediaId` int(11) DEFAULT NULL,
`artistId` int(11) DEFAULT NULL,
`isrc` varchar(15) DEFAULT NULL,
`thumbnail` blob,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_track_unique_to_eleasemedia` (`releaseMediaId`,`trackNumber`),
UNIQUE KEY `track_hash_IDX` (`hash`) USING BTREE,
KEY `ix_track_title` (`title`),
KEY `ix_track_roadieId` (`roadieId`),
KEY `track_artistId_IDX` (`artistId`) USING BTREE,
KEY `track_releaseMediaId_IDX` (`releaseMediaId`) USING BTREE,
CONSTRAINT `track_ibfk_1` FOREIGN KEY (`releaseMediaId`) REFERENCES `releasemedia` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=267358 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `trackPlaylistTrack`
--
DROP TABLE IF EXISTS `trackPlaylistTrack`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `trackPlaylistTrack` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`trackId` int(11) DEFAULT NULL,
`playlisttrackId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `ix_trackPlaylistTrack_trackId` (`trackId`),
KEY `ix_trackPlaylistTrack_playlisttrackId` (`playlisttrackId`),
CONSTRAINT `trackPlaylistTrack_ibfk_1` FOREIGN KEY (`trackId`) REFERENCES `track` (`id`),
CONSTRAINT `trackPlaylistTrack_ibfk_2` FOREIGN KEY (`playlisttrackId`) REFERENCES `playlisttrack` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`lastApiAccess` datetime DEFAULT NULL,
`username` varchar(20) NOT NULL,
`password` varchar(100) NOT NULL,
`apiToken` varchar(100) DEFAULT NULL,
`email` varchar(100) NOT NULL,
`registeredOn` datetime DEFAULT NULL,
`lastLogin` datetime DEFAULT NULL,
`isActive` tinyint(1) DEFAULT NULL,
`avatar` blob,
`doUseHtmlPlayer` tinyint(1) DEFAULT NULL,
`timezone` varchar(50) DEFAULT NULL,
`playerTrackLimit` smallint(6) DEFAULT '50',
`profile` text,
`timeformat` varchar(50) DEFAULT 'YYYY-MM-DD HH:mm:ss',
`isPrivate` tinyint(1) DEFAULT NULL,
`recentlyPlayedLimit` smallint(6) DEFAULT '50',
`randomReleaseLimit` smallint(6) DEFAULT '12',
`ftpUrl` varchar(250) DEFAULT NULL,
`ftpDirectory` varchar(500) DEFAULT NULL,
`ftpUsername` varchar(50) DEFAULT NULL,
`ftpPassword` varchar(500) DEFAULT NULL,
`AccessFailedCount` mediumint(9) DEFAULT NULL,
`ConcurrencyStamp` varchar(100) DEFAULT NULL,
`SecurityStamp` varchar(100) DEFAULT NULL,
`EmailConfirmed` bit(1) DEFAULT NULL,
`LockoutEnabled` bit(1) DEFAULT NULL,
`LockoutEnd` timestamp NULL DEFAULT NULL,
`TwoFactorEnabled` bit(1) DEFAULT NULL,
`NormalizedEmail` varchar(100) DEFAULT NULL,
`NormalizedUserName` varchar(20) DEFAULT NULL,
`PhoneNumber` varchar(100) DEFAULT NULL,
`PhoneNumberConfirmed` bit(1) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`),
UNIQUE KEY `ix_user_username` (`username`),
KEY `ix_user_roadieId` (`roadieId`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `userClaims`
--
DROP TABLE IF EXISTS `userClaims`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `userClaims` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL,
`claimType` varchar(200) NOT NULL,
`claimValue` varchar(200) NOT NULL,
PRIMARY KEY (`id`),
KEY `ix_userClaims_userId` (`userId`),
CONSTRAINT `userClaims_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `userQue`
--
DROP TABLE IF EXISTS `userQue`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `userQue` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`userId` int(11) NOT NULL,
`trackId` int(11) NOT NULL,
`position` int(11) DEFAULT NULL,
`queSortOrder` smallint(6) NOT NULL,
`isCurrent` bit(1) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idx_user` (`userId`),
KEY `userQue_ibfk_2` (`trackId`),
CONSTRAINT `userQue_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE,
CONSTRAINT `userQue_ibfk_2` FOREIGN KEY (`trackId`) REFERENCES `track` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `userRoleClaims`
--
DROP TABLE IF EXISTS `userRoleClaims`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `userRoleClaims` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userRoleId` int(11) NOT NULL,
`claimType` varchar(200) NOT NULL,
`claimValue` varchar(200) NOT NULL,
PRIMARY KEY (`id`),
KEY `ix_userRoleClaims_userRoleId` (`userRoleId`),
CONSTRAINT `userRoleClaims_ibfk_1` FOREIGN KEY (`userRoleId`) REFERENCES `userrole` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `userartist`
--
DROP TABLE IF EXISTS `userartist`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `userartist` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`isFavorite` tinyint(1) DEFAULT NULL,
`isDisliked` tinyint(1) DEFAULT NULL,
`rating` smallint(6) NOT NULL,
`userId` int(11) DEFAULT NULL,
`artistId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `userartist_userId_IDX` (`userId`,`artistId`) USING BTREE,
KEY `artistId` (`artistId`),
KEY `ix_userartist_roadieId` (`roadieId`),
CONSTRAINT `userartist_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE,
CONSTRAINT `userartist_ibfk_2` FOREIGN KEY (`artistId`) REFERENCES `artist` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `userrelease`
--
DROP TABLE IF EXISTS `userrelease`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `userrelease` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`isFavorite` tinyint(1) DEFAULT NULL,
`isDisliked` tinyint(1) DEFAULT NULL,
`rating` smallint(6) NOT NULL,
`userId` int(11) DEFAULT NULL,
`releaseId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `userrelease_userId_IDX` (`userId`,`releaseId`) USING BTREE,
KEY `releaseId` (`releaseId`),
KEY `ix_userrelease_roadieId` (`roadieId`),
CONSTRAINT `userrelease_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE,
CONSTRAINT `userrelease_ibfk_2` FOREIGN KEY (`releaseId`) REFERENCES `release` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=222 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `userrole`
--
DROP TABLE IF EXISTS `userrole`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `userrole` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`name` varchar(80) NOT NULL,
`description` varchar(200) DEFAULT NULL,
`ConcurrencyStamp` varchar(100) DEFAULT NULL,
`NormalizedName` varchar(80) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
KEY `ix_userrole_roadieId` (`roadieId`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `usersInRoles`
--
DROP TABLE IF EXISTS `usersInRoles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usersInRoles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT NULL,
`userRoleId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `userRoleId` (`userRoleId`),
KEY `ix_usersInRoles_userId` (`userId`),
CONSTRAINT `usersInRoles_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE,
CONSTRAINT `usersInRoles_ibfk_2` FOREIGN KEY (`userRoleId`) REFERENCES `userrole` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `usertrack`
--
DROP TABLE IF EXISTS `usertrack`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usertrack` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isLocked` tinyint(1) DEFAULT NULL,
`status` smallint(6) DEFAULT NULL,
`roadieId` varchar(36) DEFAULT NULL,
`createdDate` datetime DEFAULT NULL,
`lastUpdated` datetime DEFAULT NULL,
`isFavorite` tinyint(1) DEFAULT NULL,
`isDisliked` tinyint(1) DEFAULT NULL,
`rating` smallint(6) NOT NULL,
`playedCount` int(11) DEFAULT NULL,
`lastPlayed` datetime DEFAULT NULL,
`userId` int(11) DEFAULT NULL,
`trackId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `usertrack_userId_IDX` (`userId`,`trackId`) USING BTREE,
KEY `trackId` (`trackId`),
KEY `ix_usertrack_roadieId` (`roadieId`),
CONSTRAINT `usertrack_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE,
CONSTRAINT `usertrack_ibfk_2` FOREIGN KEY (`trackId`) REFERENCES `track` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=25874 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Temporary table structure for view `vTrackList`
--
DROP TABLE IF EXISTS `vTrackList`;
/*!50001 DROP VIEW IF EXISTS `vTrackList`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `vTrackList` (
`trackId` tinyint NOT NULL,
`trackRoadieId` tinyint NOT NULL,
`trackCreatedDate` tinyint NOT NULL,
`trackLastUpdated` tinyint NOT NULL,
`trackDuration` tinyint NOT NULL,
`trackFileSize` tinyint NOT NULL,
`trackPlayedCount` tinyint NOT NULL,
`trackRating` tinyint NOT NULL,
`trackTitle` tinyint NOT NULL,
`releaseMediaNumber` tinyint NOT NULL,
`releaseId` tinyint NOT NULL,
`releaseRoadieId` tinyint NOT NULL,
`releaseTitle` tinyint NOT NULL,
`releaseCreatedDate` tinyint NOT NULL,
`releaseLastUpdated` tinyint NOT NULL,
`releaseLibraryStatus` tinyint NOT NULL,
`releaseRating` tinyint NOT NULL,
`releaseDate` tinyint NOT NULL,
`releaseStatus` tinyint NOT NULL,
`releaseTrackCount` tinyint NOT NULL,
`releasePlayedCount` tinyint NOT NULL,
`artistId` tinyint NOT NULL,
`artistRoadieId` tinyint NOT NULL,
`artistName` tinyint NOT NULL,
`artistRating` tinyint NOT NULL,
`artistCreatedDate` tinyint NOT NULL,
`artistLastUpdated` tinyint NOT NULL,
`artistLastPlayed` tinyint NOT NULL,
`artistPlayedCount` tinyint NOT NULL,
`artistReleaseCount` tinyint NOT NULL,
`artistTrackCount` tinyint NOT NULL,
`artistSortName` tinyint NOT NULL,
`trackArtistId` tinyint NOT NULL,
`trackArtistRoadieId` tinyint NOT NULL,
`trackArtistName` tinyint NOT NULL,
`trackArtistRating` tinyint NOT NULL,
`trackArtistCreatedDate` tinyint NOT NULL,
`trackArtistLastUpdated` tinyint NOT NULL,
`trackArtistLastPlayed` tinyint NOT NULL,
`trackArtistPlayedCount` tinyint NOT NULL,
`trackArtistReleaseCount` tinyint NOT NULL,
`trackArtistTrackCount` tinyint NOT NULL,
`trackArtistSortName` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
--
-- Final view structure for view `vTrackList`
--
/*!50001 DROP TABLE IF EXISTS `vTrackList`*/;
/*!50001 DROP VIEW IF EXISTS `vTrackList`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8 */;
/*!50001 SET character_set_results = utf8 */;
/*!50001 SET collation_connection = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`roadie`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `vTrackList` AS select `t`.`id` AS `trackId`,`t`.`roadieId` AS `trackRoadieId`,`t`.`createdDate` AS `trackCreatedDate`,`t`.`lastUpdated` AS `trackLastUpdated`,`t`.`duration` AS `trackDuration`,`t`.`fileSize` AS `trackFileSize`,`t`.`playedCount` AS `trackPlayedCount`,`t`.`rating` AS `trackRating`,`t`.`title` AS `trackTitle`,`rm`.`releaseMediaNumber` AS `releaseMediaNumber`,`r`.`id` AS `releaseId`,`r`.`roadieId` AS `releaseRoadieId`,`r`.`title` AS `releaseTitle`,`r`.`createdDate` AS `releaseCreatedDate`,`r`.`lastUpdated` AS `releaseLastUpdated`,`r`.`libraryStatus` AS `releaseLibraryStatus`,`r`.`rating` AS `releaseRating`,`r`.`releaseDate` AS `releaseDate`,`r`.`status` AS `releaseStatus`,`r`.`trackCount` AS `releaseTrackCount`,`r`.`playedCount` AS `releasePlayedCount`,`ra`.`id` AS `artistId`,`ra`.`roadieId` AS `artistRoadieId`,`ra`.`name` AS `artistName`,`ra`.`rating` AS `artistRating`,`ra`.`createdDate` AS `artistCreatedDate`,`ra`.`lastUpdated` AS `artistLastUpdated`,`ra`.`lastPlayed` AS `artistLastPlayed`,`ra`.`playedCount` AS `artistPlayedCount`,`ra`.`releaseCount` AS `artistReleaseCount`,`ra`.`trackCount` AS `artistTrackCount`,`ra`.`sortName` AS `artistSortName`,`ta`.`id` AS `trackArtistId`,`ta`.`roadieId` AS `trackArtistRoadieId`,`ta`.`name` AS `trackArtistName`,`ta`.`rating` AS `trackArtistRating`,`ta`.`createdDate` AS `trackArtistCreatedDate`,`ta`.`lastUpdated` AS `trackArtistLastUpdated`,`ta`.`lastPlayed` AS `trackArtistLastPlayed`,`ta`.`playedCount` AS `trackArtistPlayedCount`,`ta`.`releaseCount` AS `trackArtistReleaseCount`,`ta`.`trackCount` AS `trackArtistTrackCount`,`ta`.`sortName` AS `trackArtistSortName` from ((((`track` `t` join `releasemedia` `rm` on((`t`.`releaseMediaId` = `rm`.`id`))) join `release` `r` on((`rm`.`releaseId` = `r`.`id`))) join `artist` `ra` on((`r`.`artistId` = `ra`.`id`))) left join `artist` `ta` on((`t`.`artistId` = `ta`.`id`))) where (`t`.`hash` is not null) */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
/*!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 2018-12-13 15:50:02