Fix unnecessary fk on channels for unauthenticated subscriptions.

This commit is contained in:
Kavin 2023-08-30 05:27:18 +01:00
parent e6bca8c5ee
commit 5efa4d22e5
2 changed files with 16 additions and 0 deletions

View file

@ -5,5 +5,6 @@
https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<include file="version/0-init.xml" relativeToChangelogFile="true"/>
<include file="version/1-fix-subs.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>

View file

@ -0,0 +1,15 @@
<?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="1-0" author="kavin" runInTransaction="false">
<!-- drop constraint since it prevents breaks unauthenticated subscriptions from working -->
<sql>ALTER TABLE unauthenticated_subscriptions DROP CONSTRAINT IF EXISTS fk_unauthenticated_subscriptions_id_channels;</sql>
<rollback>
<sql>ALTER TABLE unauthenticated_subscriptions ADD CONSTRAINT fk_unauthenticated_subscriptions_id_channels FOREIGN KEY (id) REFERENCES channels(uploader_id);</sql>
</rollback>
</changeSet>
</databaseChangeLog>