-- --------------------------------------------------------
-- Server OS:                    Win64
-- HeidiSQL Version:             12.8.0.6908
-- --------------------------------------------------------



-- Dumping database structure for jamswipe
CREATE DATABASE IF NOT EXISTS `jamswipe` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */;
USE `jamswipe`;

-- Dumping structure for table jamswipe.albums
CREATE TABLE IF NOT EXISTS `albums` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(250) NOT NULL,
  `artist` int(11) NOT NULL,
  `genre` int(11) NOT NULL,
  `artworkPath` varchar(500) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `FK_albums_artists` (`artist`),
  KEY `FK_albums_genres` (`genre`),
  CONSTRAINT `FK_albums_artists` FOREIGN KEY (`artist`) REFERENCES `artists` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_albums_genres` FOREIGN KEY (`genre`) REFERENCES `genres` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- Dumping data for table jamswipe.albums: ~5 rows (approximately)
INSERT INTO `albums` (`id`, `title`, `artist`, `genre`, `artworkPath`) VALUES
	(1, 'Greatest Rap Hits', 1, 4, 'assets/images/artwork/faceless.jpg'),
	(2, 'Greatest Pop Hits', 2, 2, 'assets/images/artwork/music.jpg'),
	(3, 'Greatest Pop Rock Hits', 3, 3, 'assets/images/artwork/goofy.jpg'),
	(4, 'Greatest Techno Hits', 5, 5, 'assets/images/artwork/falling.jpg'),
	(5, 'Greatest Rock Hits', 4, 1, 'assets/images/artwork/anarchy.jpg');

-- Dumping structure for table jamswipe.artists
CREATE TABLE IF NOT EXISTS `artists` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- Dumping data for table jamswipe.artists: ~5 rows (approximately)
INSERT INTO `artists` (`id`, `name`) VALUES
	(1, 'Eminem'),
	(2, 'Michael Jackson'),
	(3, 'Maroon 5'),
	(4, 'Led Zeppelin'),
	(5, 'Daft Punk');

-- Dumping structure for table jamswipe.genres
CREATE TABLE IF NOT EXISTS `genres` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- Dumping data for table jamswipe.genres: ~5 rows (approximately)
INSERT INTO `genres` (`id`, `name`) VALUES
	(1, 'Rock'),
	(2, 'Pop'),
	(3, 'Pop Rock'),
	(4, 'Rap'),
	(5, 'Techno');

-- Dumping structure for table jamswipe.playlists
CREATE TABLE IF NOT EXISTS `playlists` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `owner` varchar(50) NOT NULL,
  `dateCreated` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- Dumping data for table jamswipe.playlists: ~1 rows (approximately)
INSERT INTO `playlists` (`id`, `name`, `owner`, `dateCreated`) VALUES
	(7, '123123', 'test123123', '2025-01-15 00:00:00'),
	(8, ' bam', 'test123', '2025-02-04 00:00:00');

-- Dumping structure for table jamswipe.playlistsongs
CREATE TABLE IF NOT EXISTS `playlistsongs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `songId` int(11) NOT NULL,
  `playlistId` int(11) NOT NULL,
  `playlistOrder` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `FK_playlistsongs_songs` (`songId`),
  KEY `FK_playlistsongs_playlists` (`playlistId`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- Dumping data for table jamswipe.playlistsongs: ~8 rows (approximately)
INSERT INTO `playlistsongs` (`id`, `songId`, `playlistId`, `playlistOrder`) VALUES
	(6, 7, 7, 1),
	(7, 14, 7, 2),
	(8, 15, 7, 3),
	(9, 13, 7, 4),
	(10, 13, 8, 1),
	(11, 14, 8, 2),
	(12, 15, 8, 3),
	(13, 10, 8, 4),
	(14, 11, 8, 5);

-- Dumping structure for table jamswipe.songs
CREATE TABLE IF NOT EXISTS `songs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(250) NOT NULL,
  `artist` int(11) NOT NULL,
  `album` int(11) NOT NULL,
  `genre` int(11) NOT NULL,
  `duration` varchar(8) NOT NULL,
  `path` varchar(500) NOT NULL,
  `albumOrder` int(11) NOT NULL,
  `plays` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `FK_songs_artists` (`artist`),
  KEY `FK_songs_albums` (`album`),
  KEY `FK_songs_genres` (`genre`),
  CONSTRAINT `FK_songs_albums` FOREIGN KEY (`album`) REFERENCES `albums` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK_songs_artists` FOREIGN KEY (`artist`) REFERENCES `artists` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK_songs_genres` FOREIGN KEY (`genre`) REFERENCES `genres` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- Dumping data for table jamswipe.songs: ~15 rows (approximately)
INSERT INTO `songs` (`id`, `title`, `artist`, `album`, `genre`, `duration`, `path`, `albumOrder`, `plays`) VALUES
	(1, 'Harder, Better, Faster, Stronger', 5, 4, 5, '3:44', 'assets/music/Harder, Better, Faster, Stronger.mp3', 1, 5),
	(2, 'One More Time', 5, 4, 5, '5:20', 'assets/music/One More Time.mp3', 2, 4),
	(3, 'Around the World', 5, 4, 5, '7:09', 'assets/music/Around the World.mp3', 3, 4),
	(4, 'Whole Lotta Love', 4, 5, 1, '5:43', 'assets/music/Whole Lotta Love.mp3', 1, 9),
	(5, 'Kashmir', 4, 5, 1, '8:37', 'assets/music/Kashmir.mp3', 2, 11),
	(6, 'Stairway To Heaven', 4, 5, 1, '8:02', 'assets/music/Stairway To Heaven.mp3', 3, 9),
	(7, 'Without Me', 1, 1, 4, '4:51', 'assets/music/Without Me.mp3', 1, 10),
	(8, 'The Real Slim Shady', 1, 1, 4, '4:44', 'assets/music/The Real Slim Shady.mp3', 2, 5),
	(9, 'Lose Yourself', 1, 1, 4, '5:27', 'assets/music/Lose Yourself.mp3', 3, 5),
	(10, 'She Will Be Loved', 3, 3, 3, '4:27', 'assets/music/She Will Be Loved.mp3', 1, 5),
	(11, 'This Love', 3, 3, 3, '3:42', 'assets/music/This Love.mp3', 2, 4),
	(12, 'Sugar', 3, 3, 3, '4:24', 'assets/music/Sugar.mp3', 3, 4),
	(13, 'Thriller', 2, 2, 2, '5:58', 'assets/music/Thriller.mp3', 1, 9),
	(14, 'Billie Jean', 2, 2, 2, '4:54', 'assets/music/Billie Jean.mp3', 2, 9),
	(15, 'Beat It', 2, 2, 2, '4:18', 'assets/music/Beat It.mp3', 3, 8);

