updating sql file for database creation

updating sql file for database creation
This commit is contained in:
2026-05-11 14:45:48 -04:00
parent 315b7e0bd0
commit b2d7513cf2
4 changed files with 1914 additions and 742 deletions
+661 -8
View File
@@ -2,7 +2,7 @@
-- PostgreSQL database dump
--
\restrict Vwcqwiq0T7Wa2mK8KvZhGZRaSeFcgOrgunEbjWSCbLeRLSwJLeXqBprmQroWe9O
\restrict ioCi9akCEb4OTJqqafagnN0ujRzEOChWnb2NQKO5G1mPGHoPiOIWcce58T7EixH
-- Dumped from database version 18.3 (Ubuntu 18.3-1.pgdg25.10+1)
-- Dumped by pg_dump version 18.3 (Ubuntu 18.3-1.pgdg25.10+1)
@@ -1228,20 +1228,44 @@ CREATE VIEW library.video_items_v AS
ALTER VIEW library.video_items_v OWNER TO postgres;
--
-- Name: __EFMigrationsHistory; Type: TABLE; Schema: public; Owner: jellyfin
--
CREATE TABLE public."__EFMigrationsHistory" (
migration_id character varying(150) CONSTRAINT "__EFMigrationsHistory_MigrationId_not_null" NOT NULL,
product_version character varying(32) CONSTRAINT "__EFMigrationsHistory_ProductVersion_not_null" NOT NULL
);
ALTER TABLE public."__EFMigrationsHistory" OWNER TO jellyfin;
--
-- Name: __ef_migrations_history; Type: TABLE; Schema: public; Owner: jellyfin
--
CREATE TABLE public.__ef_migrations_history (
migration_id character varying(150) CONSTRAINT "__EFMigrationsHistory_MigrationId_not_null" NOT NULL,
product_version character varying(32) CONSTRAINT "__EFMigrationsHistory_ProductVersion_not_null" NOT NULL
migration_id character varying(150) NOT NULL,
product_version character varying(32) NOT NULL
);
ALTER TABLE public.__ef_migrations_history OWNER TO jellyfin;
--
-- Name: bloat_tables; Type: TABLE; Schema: public; Owner: jellyfin
-- Name: __efmigrationshistory; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.__efmigrationshistory (
migrationid character varying(150) NOT NULL,
productversion character varying(32) NOT NULL
);
ALTER TABLE public.__efmigrationshistory OWNER TO postgres;
--
-- Name: bloat_tables; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.bloat_tables (
@@ -1249,7 +1273,7 @@ CREATE TABLE public.bloat_tables (
);
ALTER TABLE public.bloat_tables OWNER TO jellyfin;
ALTER TABLE public.bloat_tables OWNER TO postgres;
--
-- Name: access_schedules; Type: TABLE; Schema: users; Owner: jellyfin
@@ -1581,13 +1605,37 @@ ALTER TABLE ONLY library.video_stream_details
--
-- Name: __ef_migrations_history PK___EFMigrationsHistory; Type: CONSTRAINT; Schema: public; Owner: jellyfin
-- Name: item_values_map pk_itemvaluesmap; Type: CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY public.__ef_migrations_history
ALTER TABLE ONLY library.item_values_map
ADD CONSTRAINT pk_itemvaluesmap PRIMARY KEY (item_value_id, item_id);
--
-- Name: people_base_item_map pk_peoplebaseitemmap; Type: CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.people_base_item_map
ADD CONSTRAINT pk_peoplebaseitemmap PRIMARY KEY (item_id, people_id, role);
--
-- Name: __EFMigrationsHistory PK___EFMigrationsHistory; Type: CONSTRAINT; Schema: public; Owner: jellyfin
--
ALTER TABLE ONLY public."__EFMigrationsHistory"
ADD CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY (migration_id);
--
-- Name: __efmigrationshistory pk___efmigrationshistory; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.__efmigrationshistory
ADD CONSTRAINT pk___efmigrationshistory PRIMARY KEY (migrationid);
--
-- Name: access_schedules PK_AccessSchedules; Type: CONSTRAINT; Schema: users; Owner: jellyfin
--
@@ -1634,6 +1682,13 @@ CREATE INDEX "IX_ActivityLogs_DateCreated" ON activitylog.activity_logs USING bt
CREATE INDEX idx_activitylogs_userid_datecreated ON activitylog.activity_logs USING btree (user_id, date_created DESC) WHERE (user_id IS NOT NULL);
--
-- Name: ix_activitylogs_datecreated; Type: INDEX; Schema: activitylog; Owner: jellyfin
--
CREATE INDEX ix_activitylogs_datecreated ON activitylog.activity_logs USING btree (date_created);
--
-- Name: IX_ApiKeys_AccessToken; Type: INDEX; Schema: authentication; Owner: jellyfin
--
@@ -1676,6 +1731,48 @@ CREATE INDEX "IX_Devices_DeviceId_DateLastActivity" ON authentication.devices US
CREATE INDEX "IX_Devices_UserId_DeviceId" ON authentication.devices USING btree (user_id, device_id);
--
-- Name: ix_apikeys_accesstoken; Type: INDEX; Schema: authentication; Owner: jellyfin
--
CREATE UNIQUE INDEX ix_apikeys_accesstoken ON authentication.api_keys USING btree (access_token);
--
-- Name: ix_deviceoptions_deviceid; Type: INDEX; Schema: authentication; Owner: jellyfin
--
CREATE UNIQUE INDEX ix_deviceoptions_deviceid ON authentication.device_options USING btree (device_id);
--
-- Name: ix_devices_accesstoken_datelastactivity; Type: INDEX; Schema: authentication; Owner: jellyfin
--
CREATE INDEX ix_devices_accesstoken_datelastactivity ON authentication.devices USING btree (access_token, date_last_activity);
--
-- Name: ix_devices_deviceid; Type: INDEX; Schema: authentication; Owner: jellyfin
--
CREATE INDEX ix_devices_deviceid ON authentication.devices USING btree (device_id);
--
-- Name: ix_devices_deviceid_datelastactivity; Type: INDEX; Schema: authentication; Owner: jellyfin
--
CREATE INDEX ix_devices_deviceid_datelastactivity ON authentication.devices USING btree (device_id, date_last_activity);
--
-- Name: ix_devices_userid_deviceid; Type: INDEX; Schema: authentication; Owner: jellyfin
--
CREATE INDEX ix_devices_userid_deviceid ON authentication.devices USING btree (user_id, device_id);
--
-- Name: IX_CustomItemDisplayPreferences_UserId_ItemId_Client_Key; Type: INDEX; Schema: displaypreferences; Owner: jellyfin
--
@@ -1704,6 +1801,27 @@ CREATE INDEX "IX_HomeSection_DisplayPreferencesId" ON displaypreferences.home_se
CREATE INDEX "IX_ItemDisplayPreferences_UserId" ON displaypreferences.item_display_preferences USING btree (user_id);
--
-- Name: ix_displaypreferences_userid_itemid_client; Type: INDEX; Schema: displaypreferences; Owner: jellyfin
--
CREATE UNIQUE INDEX ix_displaypreferences_userid_itemid_client ON displaypreferences.display_preferences USING btree (user_id, item_id, client);
--
-- Name: ix_homesection_displaypreferencesid; Type: INDEX; Schema: displaypreferences; Owner: jellyfin
--
CREATE INDEX ix_homesection_displaypreferencesid ON displaypreferences.home_sections USING btree (display_preferences_id);
--
-- Name: ix_itemdisplaypreferences_userid; Type: INDEX; Schema: displaypreferences; Owner: jellyfin
--
CREATE INDEX ix_itemdisplaypreferences_userid ON displaypreferences.item_display_preferences USING btree (user_id);
--
-- Name: IX_BaseItemImageInfos_ItemId; Type: INDEX; Schema: library; Owner: jellyfin
--
@@ -1830,6 +1948,97 @@ CREATE INDEX "IX_UserData_ItemId_UserId_PlaybackPositionTicks" ON library.user_d
CREATE INDEX "IX_UserData_ItemId_UserId_Played" ON library.user_data USING btree (item_id, user_id, played);
--
-- Name: baseitemproviders_providerid_idx; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX baseitemproviders_providerid_idx ON library.base_item_providers USING btree (provider_id, item_id);
--
-- Name: baseitemproviders_providervalue_idx; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX baseitemproviders_providervalue_idx ON library.base_item_providers USING btree (provider_value, provider_id);
--
-- Name: baseitems_communityrating_idx; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX baseitems_communityrating_idx ON library.base_items USING btree (community_rating DESC);
--
-- Name: baseitems_datecreated_idx; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX baseitems_datecreated_idx ON library.base_items USING btree (date_created DESC);
--
-- Name: baseitems_datemodified_idx; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX baseitems_datemodified_idx ON library.base_items USING btree (date_modified DESC);
--
-- Name: baseitems_premieredate_idx; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX baseitems_premieredate_idx ON library.base_items USING btree (premiere_date DESC);
--
-- Name: baseitems_productionyear_idx; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX baseitems_productionyear_idx ON library.base_items USING btree (production_year DESC);
--
-- Name: baseitems_sortname_idx; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX baseitems_sortname_idx ON library.base_items USING btree (sort_name);
--
-- Name: baseitems_topparentid_idx; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX baseitems_topparentid_idx ON library.base_items USING btree (top_parent_id, type);
--
-- Name: idx_baseitems_datecreated_filtered; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX idx_baseitems_datecreated_filtered ON library.base_items USING btree (date_created DESC, type, is_virtual_item) WHERE ((date_created IS NOT NULL) AND (is_virtual_item = false));
--
-- Name: idx_baseitems_presentationuniquekey_episodes; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX idx_baseitems_presentationuniquekey_episodes ON library.base_items USING btree (presentation_unique_key, top_parent_id, is_virtual_item) WHERE ((type = 'MediaBrowser.Controller.Entities.TV.Episode'::text) AND (presentation_unique_key IS NOT NULL));
--
-- Name: idx_baseitems_topparentid_isfolder; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX idx_baseitems_topparentid_isfolder ON library.base_items USING btree (top_parent_id, is_folder, is_virtual_item) WHERE (top_parent_id IS NOT NULL);
--
-- Name: idx_baseitems_type_isvirtualitem_topparentid; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX idx_baseitems_type_isvirtualitem_topparentid ON library.base_items USING btree (type, is_virtual_item, top_parent_id) WHERE (is_virtual_item = false);
--
-- Name: idx_itemvalues_cleanvalue; Type: INDEX; Schema: library; Owner: jellyfin
--
@@ -1865,6 +2074,209 @@ CREATE INDEX idx_itemvalues_value ON library.item_values USING btree (value) WHE
CREATE INDEX idx_itemvaluesmap_itemvalueid_itemid ON library.item_values_map USING btree (item_value_id, item_id);
--
-- Name: ix_ancestorids_parentitemid; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_ancestorids_parentitemid ON library.ancestor_ids USING btree (parent_item_id);
--
-- Name: ix_baseitemimageinfos_itemid; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_baseitemimageinfos_itemid ON library.base_item_image_infos USING btree (item_id);
--
-- Name: ix_baseitemmetadatafields_itemid; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_baseitemmetadatafields_itemid ON library.base_item_metadata_fields USING btree (item_id);
--
-- Name: ix_baseitemproviders_providerid_providervalue_itemid; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_baseitemproviders_providerid_providervalue_itemid ON library.base_item_providers USING btree (provider_id, provider_value, item_id);
--
-- Name: ix_baseitems_id_type_isfolder_isvirtualitem; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_baseitems_id_type_isfolder_isvirtualitem ON library.base_items USING btree (id, type, is_folder, is_virtual_item);
--
-- Name: ix_baseitems_path; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_baseitems_path ON library.base_items USING btree (path);
--
-- Name: ix_baseitems_presentationuniquekey; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_baseitems_presentationuniquekey ON library.base_items USING btree (presentation_unique_key);
--
-- Name: ix_baseitems_topparentid_id; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_baseitems_topparentid_id ON library.base_items USING btree (top_parent_id, id);
--
-- Name: ix_baseitems_type_topparentid_id; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_baseitems_type_topparentid_id ON library.base_items USING btree (type, top_parent_id, id);
--
-- Name: ix_baseitems_type_topparentid_presentationuniquekey; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_baseitems_type_topparentid_presentationuniquekey ON library.base_items USING btree (type, top_parent_id, presentation_unique_key);
--
-- Name: ix_baseitemtrailertypes_itemid; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_baseitemtrailertypes_itemid ON library.base_item_trailer_types USING btree (item_id);
--
-- Name: ix_imageinfos_userid; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE UNIQUE INDEX ix_imageinfos_userid ON library.image_infos USING btree (user_id);
--
-- Name: ix_itemvalues_type_cleanvalue; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_itemvalues_type_cleanvalue ON library.item_values USING btree (type, clean_value);
--
-- Name: ix_itemvalues_type_value; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE UNIQUE INDEX ix_itemvalues_type_value ON library.item_values USING btree (type, value);
--
-- Name: ix_itemvaluesmap_itemid; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_itemvaluesmap_itemid ON library.item_values_map USING btree (item_id);
--
-- Name: ix_mediastreaminfos_streamindex; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_mediastreaminfos_streamindex ON library.media_stream_infos USING btree (stream_index);
--
-- Name: ix_mediastreaminfos_streamindex_streamtype; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_mediastreaminfos_streamindex_streamtype ON library.media_stream_infos USING btree (stream_index, stream_type);
--
-- Name: ix_mediastreaminfos_streamindex_streamtype_language; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_mediastreaminfos_streamindex_streamtype_language ON library.media_stream_infos USING btree (stream_index, stream_type, language);
--
-- Name: ix_mediastreaminfos_streamtype; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_mediastreaminfos_streamtype ON library.media_stream_infos USING btree (stream_type);
--
-- Name: ix_peoplebaseitemmap_itemid_listorder; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_peoplebaseitemmap_itemid_listorder ON library.people_base_item_map USING btree (item_id, list_order);
--
-- Name: ix_peoplebaseitemmap_itemid_sortorder; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_peoplebaseitemmap_itemid_sortorder ON library.people_base_item_map USING btree (item_id, sort_order);
--
-- Name: ix_peoplebaseitemmap_peopleid; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_peoplebaseitemmap_peopleid ON library.people_base_item_map USING btree (people_id);
--
-- Name: ix_peoples_name; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_peoples_name ON library.peoples USING btree (name);
--
-- Name: ix_userdata_itemid_userid_isfavorite; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_userdata_itemid_userid_isfavorite ON library.user_data USING btree (item_id, user_id, is_favorite);
--
-- Name: ix_userdata_itemid_userid_lastplayeddate; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_userdata_itemid_userid_lastplayeddate ON library.user_data USING btree (item_id, user_id, last_played_date);
--
-- Name: ix_userdata_itemid_userid_playbackpositionticks; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_userdata_itemid_userid_playbackpositionticks ON library.user_data USING btree (item_id, user_id, playback_position_ticks);
--
-- Name: ix_userdata_itemid_userid_played; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_userdata_itemid_userid_played ON library.user_data USING btree (item_id, user_id, played);
--
-- Name: ix_userdata_userid; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX ix_userdata_userid ON library.user_data USING btree (user_id);
--
-- Name: mediastreaminfos_codec_idx; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX mediastreaminfos_codec_idx ON library.media_stream_infos USING btree (codec);
--
-- Name: mediastreaminfos_itemid_idx; Type: INDEX; Schema: library; Owner: jellyfin
--
@@ -1886,6 +2298,27 @@ CREATE INDEX peoplebaseitemmap_itemid_idx ON library.people_base_item_map USING
CREATE INDEX peoplebaseitemmap_peopleid_idx ON library.people_base_item_map USING btree (people_id, item_id);
--
-- Name: userdata_lastplayeddate_idx; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX userdata_lastplayeddate_idx ON library.user_data USING btree (last_played_date DESC);
--
-- Name: userdata_userid_isfavorite_idx; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX userdata_userid_isfavorite_idx ON library.user_data USING btree (user_id, is_favorite);
--
-- Name: userdata_userid_played_idx; Type: INDEX; Schema: library; Owner: jellyfin
--
CREATE INDEX userdata_userid_played_idx ON library.user_data USING btree (user_id, played);
--
-- Name: IX_AccessSchedules_UserId; Type: INDEX; Schema: users; Owner: jellyfin
--
@@ -1914,6 +2347,34 @@ CREATE UNIQUE INDEX "IX_Preferences_UserId_Kind" ON users.preferences USING btre
CREATE UNIQUE INDEX "IX_Users_Username" ON users.users USING btree (username);
--
-- Name: ix_accessschedules_userid; Type: INDEX; Schema: users; Owner: jellyfin
--
CREATE INDEX ix_accessschedules_userid ON users.access_schedules USING btree (user_id);
--
-- Name: ix_permissions_userid_kind; Type: INDEX; Schema: users; Owner: jellyfin
--
CREATE UNIQUE INDEX ix_permissions_userid_kind ON users.permissions USING btree (user_id, kind) WHERE (user_id IS NOT NULL);
--
-- Name: ix_preferences_userid_kind; Type: INDEX; Schema: users; Owner: jellyfin
--
CREATE UNIQUE INDEX ix_preferences_userid_kind ON users.preferences USING btree (user_id, kind) WHERE (user_id IS NOT NULL);
--
-- Name: ix_users_username; Type: INDEX; Schema: users; Owner: jellyfin
--
CREATE UNIQUE INDEX ix_users_username ON users.users USING btree (username);
--
-- Name: devices FK_Devices_Users_UserId; Type: FK CONSTRAINT; Schema: authentication; Owner: jellyfin
--
@@ -1922,6 +2383,14 @@ ALTER TABLE ONLY authentication.devices
ADD CONSTRAINT "FK_Devices_Users_UserId" FOREIGN KEY (user_id) REFERENCES users.users(id) ON DELETE CASCADE;
--
-- Name: devices fk_devices_users_userid; Type: FK CONSTRAINT; Schema: authentication; Owner: jellyfin
--
ALTER TABLE ONLY authentication.devices
ADD CONSTRAINT fk_devices_users_userid FOREIGN KEY (user_id) REFERENCES users.users(id) ON DELETE CASCADE;
--
-- Name: display_preferences FK_DisplayPreferences_Users_UserId; Type: FK CONSTRAINT; Schema: displaypreferences; Owner: jellyfin
--
@@ -1946,6 +2415,30 @@ ALTER TABLE ONLY displaypreferences.item_display_preferences
ADD CONSTRAINT "FK_ItemDisplayPreferences_Users_UserId" FOREIGN KEY (user_id) REFERENCES users.users(id) ON DELETE CASCADE;
--
-- Name: display_preferences fk_displaypreferences_users_userid; Type: FK CONSTRAINT; Schema: displaypreferences; Owner: jellyfin
--
ALTER TABLE ONLY displaypreferences.display_preferences
ADD CONSTRAINT fk_displaypreferences_users_userid FOREIGN KEY (user_id) REFERENCES users.users(id) ON DELETE CASCADE;
--
-- Name: home_sections fk_homesection_displaypreferences_displaypreferencesid; Type: FK CONSTRAINT; Schema: displaypreferences; Owner: jellyfin
--
ALTER TABLE ONLY displaypreferences.home_sections
ADD CONSTRAINT fk_homesection_displaypreferences_displaypreferencesid FOREIGN KEY (display_preferences_id) REFERENCES displaypreferences.display_preferences(id) ON DELETE CASCADE;
--
-- Name: item_display_preferences fk_itemdisplaypreferences_users_userid; Type: FK CONSTRAINT; Schema: displaypreferences; Owner: jellyfin
--
ALTER TABLE ONLY displaypreferences.item_display_preferences
ADD CONSTRAINT fk_itemdisplaypreferences_users_userid FOREIGN KEY (user_id) REFERENCES users.users(id) ON DELETE CASCADE;
--
-- Name: ancestor_ids FK_AncestorIds_BaseItems_ItemId; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
@@ -2130,6 +2623,142 @@ ALTER TABLE ONLY library.video_stream_details
ADD CONSTRAINT "FK_VideoStreamDetails_MediaStreamInfos_ItemId_StreamIndex" FOREIGN KEY (item_id, stream_index) REFERENCES library.media_stream_infos(item_id, stream_index) ON DELETE CASCADE;
--
-- Name: ancestor_ids fk_ancestorids_baseitems_itemid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.ancestor_ids
ADD CONSTRAINT fk_ancestorids_baseitems_itemid FOREIGN KEY (item_id) REFERENCES library.base_items(id) ON DELETE CASCADE;
--
-- Name: ancestor_ids fk_ancestorids_baseitems_parentitemid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.ancestor_ids
ADD CONSTRAINT fk_ancestorids_baseitems_parentitemid FOREIGN KEY (parent_item_id) REFERENCES library.base_items(id) ON DELETE CASCADE;
--
-- Name: attachment_stream_infos fk_attachmentstreaminfos_baseitems_itemid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.attachment_stream_infos
ADD CONSTRAINT fk_attachmentstreaminfos_baseitems_itemid FOREIGN KEY (item_id) REFERENCES library.base_items(id) ON DELETE CASCADE;
--
-- Name: base_item_image_infos fk_baseitemimageinfos_baseitems_itemid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.base_item_image_infos
ADD CONSTRAINT fk_baseitemimageinfos_baseitems_itemid FOREIGN KEY (item_id) REFERENCES library.base_items(id) ON DELETE CASCADE;
--
-- Name: base_item_metadata_fields fk_baseitemmetadatafields_baseitems_itemid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.base_item_metadata_fields
ADD CONSTRAINT fk_baseitemmetadatafields_baseitems_itemid FOREIGN KEY (item_id) REFERENCES library.base_items(id) ON DELETE CASCADE;
--
-- Name: base_item_providers fk_baseitemproviders_baseitems_itemid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.base_item_providers
ADD CONSTRAINT fk_baseitemproviders_baseitems_itemid FOREIGN KEY (item_id) REFERENCES library.base_items(id) ON DELETE CASCADE;
--
-- Name: base_item_trailer_types fk_baseitemtrailertypes_baseitems_itemid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.base_item_trailer_types
ADD CONSTRAINT fk_baseitemtrailertypes_baseitems_itemid FOREIGN KEY (item_id) REFERENCES library.base_items(id) ON DELETE CASCADE;
--
-- Name: chapters fk_chapters_baseitems_itemid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.chapters
ADD CONSTRAINT fk_chapters_baseitems_itemid FOREIGN KEY (item_id) REFERENCES library.base_items(id) ON DELETE CASCADE;
--
-- Name: image_infos fk_imageinfos_users_userid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.image_infos
ADD CONSTRAINT fk_imageinfos_users_userid FOREIGN KEY (user_id) REFERENCES users.users(id) ON DELETE CASCADE;
--
-- Name: item_values_map fk_itemvaluesmap_baseitems_itemid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.item_values_map
ADD CONSTRAINT fk_itemvaluesmap_baseitems_itemid FOREIGN KEY (item_id) REFERENCES library.base_items(id) ON DELETE CASCADE;
--
-- Name: item_values_map fk_itemvaluesmap_itemvalues_itemvalueid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.item_values_map
ADD CONSTRAINT fk_itemvaluesmap_itemvalues_itemvalueid FOREIGN KEY (item_value_id) REFERENCES library.item_values(item_value_id) ON DELETE CASCADE;
--
-- Name: keyframe_data fk_keyframedata_baseitems_itemid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.keyframe_data
ADD CONSTRAINT fk_keyframedata_baseitems_itemid FOREIGN KEY (item_id) REFERENCES library.base_items(id) ON DELETE CASCADE;
--
-- Name: media_stream_infos fk_mediastreaminfos_baseitems_itemid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.media_stream_infos
ADD CONSTRAINT fk_mediastreaminfos_baseitems_itemid FOREIGN KEY (item_id) REFERENCES library.base_items(id) ON DELETE CASCADE;
--
-- Name: people_base_item_map fk_peoplebaseitemmap_baseitems_itemid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.people_base_item_map
ADD CONSTRAINT fk_peoplebaseitemmap_baseitems_itemid FOREIGN KEY (item_id) REFERENCES library.base_items(id) ON DELETE CASCADE;
--
-- Name: people_base_item_map fk_peoplebaseitemmap_peoples_peopleid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.people_base_item_map
ADD CONSTRAINT fk_peoplebaseitemmap_peoples_peopleid FOREIGN KEY (people_id) REFERENCES library.peoples(id) ON DELETE CASCADE;
--
-- Name: user_data fk_userdata_baseitems_itemid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.user_data
ADD CONSTRAINT fk_userdata_baseitems_itemid FOREIGN KEY (item_id) REFERENCES library.base_items(id) ON DELETE CASCADE;
--
-- Name: user_data fk_userdata_users_userid; Type: FK CONSTRAINT; Schema: library; Owner: jellyfin
--
ALTER TABLE ONLY library.user_data
ADD CONSTRAINT fk_userdata_users_userid FOREIGN KEY (user_id) REFERENCES users.users(id) ON DELETE CASCADE;
--
-- Name: access_schedules FK_AccessSchedules_Users_UserId; Type: FK CONSTRAINT; Schema: users; Owner: jellyfin
--
@@ -2154,9 +2783,33 @@ ALTER TABLE ONLY users.preferences
ADD CONSTRAINT "FK_Preferences_Users_UserId" FOREIGN KEY (user_id) REFERENCES users.users(id) ON DELETE CASCADE;
--
-- Name: access_schedules fk_accessschedules_users_userid; Type: FK CONSTRAINT; Schema: users; Owner: jellyfin
--
ALTER TABLE ONLY users.access_schedules
ADD CONSTRAINT fk_accessschedules_users_userid FOREIGN KEY (user_id) REFERENCES users.users(id) ON DELETE CASCADE;
--
-- Name: permissions fk_permissions_users_userid; Type: FK CONSTRAINT; Schema: users; Owner: jellyfin
--
ALTER TABLE ONLY users.permissions
ADD CONSTRAINT fk_permissions_users_userid FOREIGN KEY (user_id) REFERENCES users.users(id) ON DELETE CASCADE;
--
-- Name: preferences fk_preferences_users_userid; Type: FK CONSTRAINT; Schema: users; Owner: jellyfin
--
ALTER TABLE ONLY users.preferences
ADD CONSTRAINT fk_preferences_users_userid FOREIGN KEY (user_id) REFERENCES users.users(id) ON DELETE CASCADE;
--
-- PostgreSQL database dump complete
--
\unrestrict Vwcqwiq0T7Wa2mK8KvZhGZRaSeFcgOrgunEbjWSCbLeRLSwJLeXqBprmQroWe9O
\unrestrict ioCi9akCEb4OTJqqafagnN0ujRzEOChWnb2NQKO5G1mPGHoPiOIWcce58T7EixH
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.