jukebox-media-server 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -59,7 +59,7 @@ CREATE TABLE `__new_watch_progress` (
59
59
  FOREIGN KEY (`episode_id`) REFERENCES `episodes`(`id`) ON UPDATE no action ON DELETE no action
60
60
  );
61
61
  --> statement-breakpoint
62
- INSERT INTO `__new_watch_progress`("id", "movie_id", "episode_id", "current_time", "duration", "updated_at") SELECT "id", "movie_id", "episode_id", "current_time", "duration", "updated_at" FROM `watch_progress`;--> statement-breakpoint
62
+ INSERT INTO `__new_watch_progress`("id", "movie_id", "episode_id", "current_time", "duration", "updated_at") SELECT "id", "movie_id", NULL, "current_time", "duration", "updated_at" FROM `watch_progress`;--> statement-breakpoint
63
63
  DROP TABLE `watch_progress`;--> statement-breakpoint
64
64
  ALTER TABLE `__new_watch_progress` RENAME TO `watch_progress`;--> statement-breakpoint
65
65
  PRAGMA foreign_keys=ON;--> statement-breakpoint
@@ -0,0 +1,42 @@
1
+ CREATE TABLE `profiles` (
2
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
3
+ `name` text NOT NULL,
4
+ `emoji` text NOT NULL,
5
+ `created_at` integer NOT NULL
6
+ );
7
+ --> statement-breakpoint
8
+ CREATE UNIQUE INDEX `profiles_name_unique` ON `profiles` (`name`);--> statement-breakpoint
9
+ INSERT INTO `profiles` (`id`, `name`, `emoji`, `created_at`) VALUES (1, 'Default', '🍿', unixepoch());--> statement-breakpoint
10
+ CREATE TABLE `favorites` (
11
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
12
+ `profile_id` integer NOT NULL,
13
+ `movie_id` integer,
14
+ `show_id` integer,
15
+ `created_at` integer NOT NULL,
16
+ FOREIGN KEY (`profile_id`) REFERENCES `profiles`(`id`) ON UPDATE no action ON DELETE cascade,
17
+ FOREIGN KEY (`movie_id`) REFERENCES `movies`(`id`) ON UPDATE no action ON DELETE cascade,
18
+ FOREIGN KEY (`show_id`) REFERENCES `shows`(`id`) ON UPDATE no action ON DELETE cascade
19
+ );
20
+ --> statement-breakpoint
21
+ CREATE UNIQUE INDEX `favorites_profile_movie_idx` ON `favorites` (`profile_id`,`movie_id`);--> statement-breakpoint
22
+ CREATE UNIQUE INDEX `favorites_profile_show_idx` ON `favorites` (`profile_id`,`show_id`);--> statement-breakpoint
23
+ CREATE TABLE `__new_watch_progress` (
24
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
25
+ `profile_id` integer NOT NULL,
26
+ `movie_id` integer,
27
+ `episode_id` integer,
28
+ `current_time` integer NOT NULL,
29
+ `duration` integer,
30
+ `updated_at` integer NOT NULL,
31
+ FOREIGN KEY (`profile_id`) REFERENCES `profiles`(`id`) ON UPDATE no action ON DELETE cascade,
32
+ FOREIGN KEY (`movie_id`) REFERENCES `movies`(`id`) ON UPDATE no action ON DELETE no action,
33
+ FOREIGN KEY (`episode_id`) REFERENCES `episodes`(`id`) ON UPDATE no action ON DELETE no action
34
+ );
35
+ --> statement-breakpoint
36
+ INSERT INTO `__new_watch_progress` (`id`, `profile_id`, `movie_id`, `episode_id`, `current_time`, `duration`, `updated_at`)
37
+ SELECT `id`, 1, `movie_id`, `episode_id`, `current_time`, `duration`, `updated_at` FROM `watch_progress`;
38
+ --> statement-breakpoint
39
+ DROP TABLE `watch_progress`;--> statement-breakpoint
40
+ ALTER TABLE `__new_watch_progress` RENAME TO `watch_progress`;--> statement-breakpoint
41
+ CREATE UNIQUE INDEX `watch_progress_profile_movie_idx` ON `watch_progress` (`profile_id`,`movie_id`);--> statement-breakpoint
42
+ CREATE UNIQUE INDEX `watch_progress_profile_episode_idx` ON `watch_progress` (`profile_id`,`episode_id`);
@@ -0,0 +1,13 @@
1
+ CREATE TABLE `auth_config` (
2
+ `id` integer PRIMARY KEY NOT NULL,
3
+ `password_hash` text,
4
+ `updated_at` integer NOT NULL
5
+ );
6
+ --> statement-breakpoint
7
+ CREATE TABLE `sessions` (
8
+ `id` text PRIMARY KEY NOT NULL,
9
+ `created_at` integer NOT NULL,
10
+ `expires_at` integer NOT NULL,
11
+ `last_seen_at` integer NOT NULL,
12
+ `user_agent` text
13
+ );