Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Use normal dialect-split upgrade
Browse files Browse the repository at this point in the history
as there are no foreign keys referencing signalmeow_contacts
  • Loading branch information
AndrewFerr committed Mar 12, 2024
1 parent c0f5706 commit c229851
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pkg/signalmeow/store/upgrades/00-latest.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- v0 -> v9: Latest revision
-- v0 -> v8: Latest revision
CREATE TABLE signalmeow_device (
aci_uuid TEXT PRIMARY KEY,

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
-- v7 -> v8: Migration from https://github.com/mautrix/signal/pull/449 to match the new v8 upgrade (Postgres)
-- only: postgres

-- v7 -> v8: Migration from https://github.com/mautrix/signal/pull/449 to match the new v8 upgrade
ALTER TABLE signalmeow_contacts DROP COLUMN profile_avatar_hash;
ALTER TABLE signalmeow_contacts RENAME COLUMN profile_fetch_ts TO profile_fetched_at;
ALTER TABLE signalmeow_contacts ALTER COLUMN profile_fetched_at DROP DEFAULT;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
-- v9: Migration from https://github.com/mautrix/signal/pull/449 to match the new v8 upgrade (SQLite)
-- transaction: off
-- only: sqlite

-- This is separate from v8 so that postgres can run with transaction: on
-- (split upgrades by dialect don't currently allow disabling transaction in only one dialect)

PRAGMA foreign_keys = OFF;
BEGIN;

-- v7 -> v8: Migration from https://github.com/mautrix/signal/pull/449 to match the new v8 upgrade
ALTER TABLE signalmeow_contacts DROP COLUMN profile_avatar_hash;

CREATE TABLE signalmeow_contacts_new (
Expand Down Expand Up @@ -43,7 +34,3 @@ FROM signalmeow_contacts;

DROP TABLE signalmeow_contacts;
ALTER TABLE signalmeow_contacts_new RENAME TO signalmeow_contacts;

PRAGMA foreign_key_check;
COMMIT;
PRAGMA foreign_keys = ON;

0 comments on commit c229851

Please sign in to comment.