jukebox-media-server 0.1.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.
@@ -0,0 +1,28 @@
1
+ CREATE TABLE `movies` (
2
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
3
+ `title` text NOT NULL,
4
+ `file_path` text NOT NULL,
5
+ `file_name` text NOT NULL,
6
+ `file_size` integer,
7
+ `extension` text,
8
+ `created_at` integer NOT NULL,
9
+ `updated_at` integer NOT NULL,
10
+ `tmdb_id` integer,
11
+ `year` integer,
12
+ `overview` text,
13
+ `runtime` integer,
14
+ `genres` text,
15
+ `rating` real,
16
+ `poster_path` text,
17
+ `backdrop_path` text
18
+ );
19
+ --> statement-breakpoint
20
+ CREATE UNIQUE INDEX `movies_file_path_unique` ON `movies` (`file_path`);--> statement-breakpoint
21
+ CREATE TABLE `watch_progress` (
22
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
23
+ `movie_id` integer NOT NULL,
24
+ `current_time` integer NOT NULL,
25
+ `duration` integer,
26
+ `updated_at` integer NOT NULL,
27
+ FOREIGN KEY (`movie_id`) REFERENCES `movies`(`id`) ON UPDATE no action ON DELETE no action
28
+ );
@@ -0,0 +1,66 @@
1
+ CREATE TABLE `episodes` (
2
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
3
+ `show_id` integer NOT NULL,
4
+ `season_id` integer NOT NULL,
5
+ `season_number` integer NOT NULL,
6
+ `episode_number` integer NOT NULL,
7
+ `title` text NOT NULL,
8
+ `file_path` text NOT NULL,
9
+ `file_name` text NOT NULL,
10
+ `file_size` integer,
11
+ `extension` text,
12
+ `tmdb_id` integer,
13
+ `overview` text,
14
+ `runtime` integer,
15
+ `still_path` text,
16
+ `created_at` integer NOT NULL,
17
+ `updated_at` integer NOT NULL,
18
+ FOREIGN KEY (`show_id`) REFERENCES `shows`(`id`) ON UPDATE no action ON DELETE no action,
19
+ FOREIGN KEY (`season_id`) REFERENCES `seasons`(`id`) ON UPDATE no action ON DELETE no action
20
+ );
21
+ --> statement-breakpoint
22
+ CREATE UNIQUE INDEX `episodes_file_path_unique` ON `episodes` (`file_path`);--> statement-breakpoint
23
+ CREATE TABLE `seasons` (
24
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
25
+ `show_id` integer NOT NULL,
26
+ `season_number` integer NOT NULL,
27
+ `name` text,
28
+ `overview` text,
29
+ `poster_path` text,
30
+ `episode_count` integer,
31
+ FOREIGN KEY (`show_id`) REFERENCES `shows`(`id`) ON UPDATE no action ON DELETE no action
32
+ );
33
+ --> statement-breakpoint
34
+ CREATE TABLE `shows` (
35
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
36
+ `title` text NOT NULL,
37
+ `folder_path` text NOT NULL,
38
+ `tmdb_id` integer,
39
+ `year` integer,
40
+ `overview` text,
41
+ `genres` text,
42
+ `rating` real,
43
+ `poster_path` text,
44
+ `backdrop_path` text,
45
+ `created_at` integer NOT NULL,
46
+ `updated_at` integer NOT NULL
47
+ );
48
+ --> statement-breakpoint
49
+ CREATE UNIQUE INDEX `shows_folder_path_unique` ON `shows` (`folder_path`);--> statement-breakpoint
50
+ PRAGMA foreign_keys=OFF;--> statement-breakpoint
51
+ CREATE TABLE `__new_watch_progress` (
52
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
53
+ `movie_id` integer,
54
+ `episode_id` integer,
55
+ `current_time` integer NOT NULL,
56
+ `duration` integer,
57
+ `updated_at` integer NOT NULL,
58
+ FOREIGN KEY (`movie_id`) REFERENCES `movies`(`id`) ON UPDATE no action ON DELETE no action,
59
+ FOREIGN KEY (`episode_id`) REFERENCES `episodes`(`id`) ON UPDATE no action ON DELETE no action
60
+ );
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
63
+ DROP TABLE `watch_progress`;--> statement-breakpoint
64
+ ALTER TABLE `__new_watch_progress` RENAME TO `watch_progress`;--> statement-breakpoint
65
+ PRAGMA foreign_keys=ON;--> statement-breakpoint
66
+ ALTER TABLE `movies` ADD `trailer_url` text;
@@ -0,0 +1,9 @@
1
+ CREATE TABLE `libraries` (
2
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
3
+ `name` text NOT NULL,
4
+ `path` text NOT NULL,
5
+ `type` text NOT NULL,
6
+ `created_at` integer NOT NULL
7
+ );
8
+ --> statement-breakpoint
9
+ CREATE UNIQUE INDEX `libraries_path_unique` ON `libraries` (`path`);
@@ -0,0 +1,201 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "073e73d5-e2f5-4cd9-8fd8-70dd1771aaa2",
5
+ "prevId": "00000000-0000-0000-0000-000000000000",
6
+ "tables": {
7
+ "movies": {
8
+ "name": "movies",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "integer",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": true
16
+ },
17
+ "title": {
18
+ "name": "title",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "file_path": {
25
+ "name": "file_path",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "file_name": {
32
+ "name": "file_name",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": true,
36
+ "autoincrement": false
37
+ },
38
+ "file_size": {
39
+ "name": "file_size",
40
+ "type": "integer",
41
+ "primaryKey": false,
42
+ "notNull": false,
43
+ "autoincrement": false
44
+ },
45
+ "extension": {
46
+ "name": "extension",
47
+ "type": "text",
48
+ "primaryKey": false,
49
+ "notNull": false,
50
+ "autoincrement": false
51
+ },
52
+ "created_at": {
53
+ "name": "created_at",
54
+ "type": "integer",
55
+ "primaryKey": false,
56
+ "notNull": true,
57
+ "autoincrement": false
58
+ },
59
+ "updated_at": {
60
+ "name": "updated_at",
61
+ "type": "integer",
62
+ "primaryKey": false,
63
+ "notNull": true,
64
+ "autoincrement": false
65
+ },
66
+ "tmdb_id": {
67
+ "name": "tmdb_id",
68
+ "type": "integer",
69
+ "primaryKey": false,
70
+ "notNull": false,
71
+ "autoincrement": false
72
+ },
73
+ "year": {
74
+ "name": "year",
75
+ "type": "integer",
76
+ "primaryKey": false,
77
+ "notNull": false,
78
+ "autoincrement": false
79
+ },
80
+ "overview": {
81
+ "name": "overview",
82
+ "type": "text",
83
+ "primaryKey": false,
84
+ "notNull": false,
85
+ "autoincrement": false
86
+ },
87
+ "runtime": {
88
+ "name": "runtime",
89
+ "type": "integer",
90
+ "primaryKey": false,
91
+ "notNull": false,
92
+ "autoincrement": false
93
+ },
94
+ "genres": {
95
+ "name": "genres",
96
+ "type": "text",
97
+ "primaryKey": false,
98
+ "notNull": false,
99
+ "autoincrement": false
100
+ },
101
+ "rating": {
102
+ "name": "rating",
103
+ "type": "real",
104
+ "primaryKey": false,
105
+ "notNull": false,
106
+ "autoincrement": false
107
+ },
108
+ "poster_path": {
109
+ "name": "poster_path",
110
+ "type": "text",
111
+ "primaryKey": false,
112
+ "notNull": false,
113
+ "autoincrement": false
114
+ },
115
+ "backdrop_path": {
116
+ "name": "backdrop_path",
117
+ "type": "text",
118
+ "primaryKey": false,
119
+ "notNull": false,
120
+ "autoincrement": false
121
+ }
122
+ },
123
+ "indexes": {
124
+ "movies_file_path_unique": {
125
+ "name": "movies_file_path_unique",
126
+ "columns": ["file_path"],
127
+ "isUnique": true
128
+ }
129
+ },
130
+ "foreignKeys": {},
131
+ "compositePrimaryKeys": {},
132
+ "uniqueConstraints": {},
133
+ "checkConstraints": {}
134
+ },
135
+ "watch_progress": {
136
+ "name": "watch_progress",
137
+ "columns": {
138
+ "id": {
139
+ "name": "id",
140
+ "type": "integer",
141
+ "primaryKey": true,
142
+ "notNull": true,
143
+ "autoincrement": true
144
+ },
145
+ "movie_id": {
146
+ "name": "movie_id",
147
+ "type": "integer",
148
+ "primaryKey": false,
149
+ "notNull": true,
150
+ "autoincrement": false
151
+ },
152
+ "current_time": {
153
+ "name": "current_time",
154
+ "type": "integer",
155
+ "primaryKey": false,
156
+ "notNull": true,
157
+ "autoincrement": false
158
+ },
159
+ "duration": {
160
+ "name": "duration",
161
+ "type": "integer",
162
+ "primaryKey": false,
163
+ "notNull": false,
164
+ "autoincrement": false
165
+ },
166
+ "updated_at": {
167
+ "name": "updated_at",
168
+ "type": "integer",
169
+ "primaryKey": false,
170
+ "notNull": true,
171
+ "autoincrement": false
172
+ }
173
+ },
174
+ "indexes": {},
175
+ "foreignKeys": {
176
+ "watch_progress_movie_id_movies_id_fk": {
177
+ "name": "watch_progress_movie_id_movies_id_fk",
178
+ "tableFrom": "watch_progress",
179
+ "tableTo": "movies",
180
+ "columnsFrom": ["movie_id"],
181
+ "columnsTo": ["id"],
182
+ "onDelete": "no action",
183
+ "onUpdate": "no action"
184
+ }
185
+ },
186
+ "compositePrimaryKeys": {},
187
+ "uniqueConstraints": {},
188
+ "checkConstraints": {}
189
+ }
190
+ },
191
+ "views": {},
192
+ "enums": {},
193
+ "_meta": {
194
+ "schemas": {},
195
+ "tables": {},
196
+ "columns": {}
197
+ },
198
+ "internal": {
199
+ "indexes": {}
200
+ }
201
+ }