mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2025-04-28 16:00:29 +05:30
fix: playlists videos removal for PostgreSQL (#835)
* Fix playlists videos removal for PostgreSQL Fixes the constraint violation error upon removing a video from a playlist with PostgreSQL Resolves TeamPiped/Piped#2814 * Replace comment * Show responses for the requests in api-test.sh * Revert "Show responses for the requests in api-test.sh" This reverts commit 29f6447fec1443043d2cd7ecf2c623bc3fa33bea.
This commit is contained in:
parent
6e6705f26c
commit
012ed81774
@ -6,4 +6,5 @@
|
|||||||
|
|
||||||
<include file="version/0-init.xml" relativeToChangelogFile="true"/>
|
<include file="version/0-init.xml" relativeToChangelogFile="true"/>
|
||||||
<include file="version/1-fix-subs.xml" relativeToChangelogFile="true"/>
|
<include file="version/1-fix-subs.xml" relativeToChangelogFile="true"/>
|
||||||
|
<include file="version/2-fix-playlist-reordering-in-postgresql.xml" relativeToChangelogFile="true"/>
|
||||||
</databaseChangeLog>
|
</databaseChangeLog>
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
|
||||||
|
https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
|
||||||
|
|
||||||
|
<changeSet id="2-0-postgresql" author="valentins.paramonovs" dbms="postgresql">
|
||||||
|
<!-- delay constraint checks until the end of the transaction to allow videos in a playlist to be reordered without worrying about the update execution order -->
|
||||||
|
<sql>ALTER TABLE playlists_videos_ids DROP CONSTRAINT playlists_videos_ids_pkey;</sql>
|
||||||
|
<sql>ALTER TABLE playlists_videos_ids ADD CONSTRAINT playlists_videos_ids_pkey PRIMARY KEY (playlist_id, videos_order) DEFERRABLE INITIALLY DEFERRED;</sql>
|
||||||
|
<rollback>
|
||||||
|
<sql>ALTER TABLE playlists_videos_ids DROP CONSTRAINT playlists_videos_ids_pkey;</sql>
|
||||||
|
<sql>ALTER TABLE playlists_videos_ids ADD CONSTRAINT playlists_videos_ids_pkey PRIMARY KEY (playlist_id, videos_order);</sql>
|
||||||
|
</rollback>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
</databaseChangeLog>
|
Loading…
x
Reference in New Issue
Block a user