diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fb2d569..405e2755 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ CHANGE: Updated `github.com/rubenv/sql-migrate` to `v1.6.0` -FIX: The migration `sqlite3/015_v0_4_19_share_unique_name_constraint.sql` has been adjusted to remove soft-deleted records from the `frontends` table when applying. This was necessary to properly support the foreign key relationship when migrating. A future release will revisit sqlite3 foreign key relationships (https://github.com/openziti/zrok/issues/504) +FIX: The migration `sqlite3/015_v0_4_19_share_unique_name_constraint.sql` has been adjusted to delete the old `shares_old` table as the last step of the migration process. Not sure exactly why, but SQLite is unhappy otherwise (https://github.com/openziti/zrok/issues/504) ## v0.4.20 diff --git a/controller/store/sql/sqlite3/015_v0_4_19_share_unique_name_constraint.sql b/controller/store/sql/sqlite3/015_v0_4_19_share_unique_name_constraint.sql index 09e37302..a4d6a733 100644 --- a/controller/store/sql/sqlite3/015_v0_4_19_share_unique_name_constraint.sql +++ b/controller/store/sql/sqlite3/015_v0_4_19_share_unique_name_constraint.sql @@ -22,7 +22,6 @@ create table shares ( constraint chk_backend_mode check (backend_mode == 'proxy' or backend_mode == 'web' or backend_mode == 'tcpTunnel' or backend_mode == 'udpTunnel' or backend_mode == 'caddy' or backend_mode == 'drive') ); insert into shares select * from shares_old; -drop table shares_old; create unique index shares_token_idx ON shares(token) WHERE deleted is false; alter table frontends rename to frontends_old; @@ -39,7 +38,7 @@ create table frontends ( deleted boolean not null default(false), private_share_id integer references shares(id) ); -insert into frontends select * from frontends_old where not deleted; +insert into frontends select * from frontends_old; drop table frontends_old; alter table share_limit_journal rename to share_limit_journal_old; @@ -53,4 +52,6 @@ create table share_limit_journal ( updated_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')) ); insert into share_limit_journal select * from share_limit_journal_old; -drop table share_limit_journal_old; \ No newline at end of file +drop table share_limit_journal_old; + +drop table shares_old; \ No newline at end of file