-- --------------------------------------------------------
-- Host:                         127.0.0.1
-- Server version:               10.4.32-MariaDB - mariadb.org binary distribution
-- Server OS:                    Win64
-- HeidiSQL Version:             12.10.0.7000
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!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 */;


-- 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, 'This Is Harris Keller', 1, 4, 'assets/images/artwork/faceless.jpg'),
	(2, 'This Is Kevin MacLeod', 2, 2, 'assets/images/artwork/music.jpg'),
	(3, 'This Is Liborio Conti', 3, 3, 'assets/images/artwork/goofy.jpg'),
	(4, 'This Is Silent Partner', 4, 5, 'assets/images/artwork/falling.jpg'),
	(5, 'We Are StreamBeats Original', 5, 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, 'Harris Keller'),
	(2, 'Kevin MacLeod'),
	(3, 'Liborio Conti'),
	(4, 'Silent Partner'),
	(5, 'StreamBeats Originals');

-- 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, 'Reggae'),
	(4, 'Rap'),
	(5, 'Techno'),
	(6, 'Dance');

-- 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: ~2 rows (approximately)
INSERT INTO `playlists` (`id`, `name`, `owner`, `dateCreated`) VALUES
	(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=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- Dumping data for table jamswipe.playlistsongs: ~5 rows (approximately)
INSERT INTO `playlistsongs` (`id`, `songId`, `playlistId`, `playlistOrder`) VALUES
	(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, 'Fjord', 1, 1, 5, '2:17', 'assets/music/Harris Keller - Fjord.mp3', 1, 5),
	(2, 'Never Be The Same', 1, 1, 5, '3:48', 'assets/music/Harris Keller - Never Be The Same.mp3', 2, 4),
	(3, 'Wreck', 1, 1, 5, '3:17', 'assets/music/Harris Keller - Wreck.mp3', 3, 4),
	(4, 'Blippy Trance', 2, 2, 1, '2:00', 'assets/music/Kevin MacLeod - Blippy Trance.mp3', 1, 9),
	(5, 'Stompin At Midnight', 2, 2, 1, '1:57', 'assets/music/Kevin MacLeod - Stompin at Midnight.mp3', 2, 11),
	(6, 'Swing Machine', 2, 2, 1, '2:14', 'assets/music/Kevin MacLeod - Swing Machining.mp3', 3, 9),
	(7, 'You Found Me', 3, 3, 4, '3:39', 'assets/music/Liborio Conti - You Found Me.mp3', 1, 10),
	(8, 'Reggae', 3, 3, 4, '3:43', 'assets/music/Liborio Conti - Reggae.mp3', 2, 5),
	(9, 'Run Away', 3, 3, 4, '3:20', 'assets/music/Liborio Conti - Run Away.mp3', 3, 6),
	(10, 'Alright', 4, 4, 3, '2:22', 'assets/music/Silent Partner - Alright.mp3', 1, 5),
	(11, 'Back In Town', 4, 4, 3, '1:51', 'assets/music/Silent Partner - Back In Town.mp3', 2, 4),
	(12, 'Crispy', 4, 4, 3, '2:06', 'assets/music/Silent Partner - Crispy.mp3', 3, 4),
	(13, 'Demon', 5, 5, 2, '2:44', 'assets/music/StreamBeats Originals - Demon.mp3', 1, 9),
	(14, 'Kill It Anyway', 5, 5, 2, '2:48', 'assets/music/StreamBeats Originals - Kill It Anyway.mp3', 2, 11),
	(15, 'What If', 5, 5, 2, '3:33', 'assets/music/StreamBeats Originals - What If.mp3', 3, 8);

-- Dumping structure for table jamswipe.users
CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(25) NOT NULL,
  `email` varchar(50) NOT NULL,
  `password` varchar(32) NOT NULL,
  `signUpDate` datetime NOT NULL,
  `profilePic` varchar(500) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- Dumping data for table jamswipe.users: ~2 rows (approximately)
INSERT INTO `users` (`id`, `username`, `email`, `password`, `signUpDate`, `profilePic`) VALUES
	(9, 'Kefflo123', 'armandsreimanis@inbox.lv', '1a1233cfb69d7f27211e36aff9ec373a', '2025-01-31 00:00:00', 'assets/images/profile-pics/user.jpg'),
	(10, 'test123', 'abc123@inbox.lv', 'c37db765ab856cf1b9e9209c2c6aae62', '2025-02-04 00:00:00', 'assets/images/profile-pics/user.jpg'),
	(11, 'test12312', 'asd123@gmail.com', '2664f490116a812596838fc11da5d5d9', '2025-04-10 00:00:00', 'assets/images/profile-pics/user.jpg');

/*!40103 SET TIME_ZONE=IFNULL(@OLD_TIME_ZONE, 'system') */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
