mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-10-24 02:02:45 +00:00
token types and migration (WIP, does not compile)
This commit is contained in:
8 files changed
+175
-94
No files matched your search
@@ -12,7 +12,8 @@ import Text.RawString.QQ (r)
|
||||
ntfServerSchemaMigrations :: [(String, Text, Maybe Text)]
|
||||
ntfServerSchemaMigrations =
|
||||
[ ("20250417_initial", m20250417_initial, Nothing),
|
||||
("20250517_service_cert", m20250517_service_cert, Just down_m20250517_service_cert)
|
||||
("20250517_service_cert", m20250517_service_cert, Just down_m20250517_service_cert),
|
||||
("20250916_webpush", m20250916_webpush, Just down_m20250916_webpush)
|
||||
]
|
||||
|
||||
-- | The list of migrations in ascending order by date
|
||||
@@ -104,3 +105,34 @@ ALTER TABLE smp_servers DROP COLUMN ntf_service_id;
|
||||
|
||||
ALTER TABLE subscriptions DROP COLUMN ntf_service_assoc;
|
||||
|]
|
||||
|
||||
m20250916_webpush :: Text
|
||||
m20250916_webpush =
|
||||
T.pack
|
||||
[r|
|
||||
CREATE TABLE webpush_servers(
|
||||
wp_server_id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
|
||||
wp_host TEXT NOT NULL,
|
||||
wp_port TEXT NOT NULL,
|
||||
wp_keyhash BYTEA NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE tokens
|
||||
ADD COLUMN wp_server_id BIGINT REFERENCES webpush_servers ON DELETE RESTRICT ON UPDATE RESTRICT,
|
||||
ADD COLUMN wp_path TEXT,
|
||||
ADD COLUMN wp_auth BYTEA,
|
||||
ADD COLUMN wp_key BYTEA;
|
||||
|]
|
||||
|
||||
down_m20250916_webpush :: Text
|
||||
down_m20250916_webpush =
|
||||
T.pack
|
||||
[r|
|
||||
ALTER TABLE tokens
|
||||
DROP COLUMN wp_server_id,
|
||||
DROP COLUMN wp_path,
|
||||
DROP COLUMN wp_auth,
|
||||
DROP COLUMN wp_key;
|
||||
|
||||
DROP TABLE webpush_servers;
|
||||
|]
|
||||
Reference in new issue
Block a user