Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/resources/changelog/db.changelog-master.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@

<include file="version/0-init.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>
Original file line number Diff line number Diff line change
@@ -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>
2 changes: 1 addition & 1 deletion testing/api-test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

CURLOPTS=(-i -s -S --max-time 60 -o /dev/null -f -w "%{http_code}\tTime:\t%{time_starttransfer}\t%{url_effective}\n")
CURLOPTS=(-i -s -S --max-time 60 -f -w "%{http_code}\tTime:\t%{time_starttransfer}\t%{url_effective}\n")
HOST="127.0.0.1:8080"

# Healthcheck Test
Expand Down
Loading