update channel model

This commit is contained in:
Ren Amamiya
2023-04-25 10:17:36 +07:00
parent 53fd29ddb8
commit 08d2625d36
10 changed files with 168 additions and 129 deletions

View File

@@ -0,0 +1,3 @@
-- Add migration script here
-- add pubkey to channel
ALTER TABLE channels ADD pubkey TEXT NOT NULL DEFAULT '';

View File

@@ -0,0 +1,40 @@
-- Add migration script here
INSERT
OR IGNORE INTO channels (event_id, pubkey, metadata, created_at)
VALUES
(
"e3cadf5beca1b2af1cddaa41a633679bedf263e3de1eb229c6686c50d85df753",
"126103bfddc8df256b6e0abfd7f3797c80dcc4ea88f7c2f87dd4104220b4d65f",
'{"name":"lume-general","picture":"https://void.cat/d/UNyxBmAh1MUx5gQTX95jyf.webp","about":"General channel for Lume"}',
1681898574
);
INSERT
OR IGNORE INTO channels (event_id, pubkey, metadata, created_at)
VALUES
(
"1abf8948d2fd05dd1836b33b324dca65138b2e80c77b27eeeed4323246efba4d",
"126103bfddc8df256b6e0abfd7f3797c80dcc4ea88f7c2f87dd4104220b4d65f",
'{"picture":"https://void.cat/d/MsqUKXXC4SxDfmT2KiHovJ.webp","name":"Arcade Open R&D","about":""}',
1682252461
);
INSERT
OR IGNORE INTO channels (event_id, pubkey, metadata, created_at)
VALUES
(
"42224859763652914db53052103f0b744df79dfc4efef7e950fc0802fc3df3c5",
"460c25e682fda7832b52d1f22d3d22b3176d972f60dcdc3212ed8c92ef85065c",
'{"about":"General discussion about the Amethyst Nostr client for Android","name":"Amethyst Users","picture":"https://nostr.build/i/5970.png"}',
1674092111
);
INSERT
OR IGNORE INTO channels (event_id, pubkey, metadata, created_at)
VALUES
(
"25e5c82273a271cb1a840d0060391a0bf4965cafeb029d5ab55350b418953fbb",
"ed1d0e1f743a7d19aa2dfb0162df73bacdbc699f67cc55bb91a98c35f7deac69",
'{"about":"","name":"Nostr","picture":"https://cloudflare-ipfs.com/ipfs/QmTN4Eas9atUULVbEAbUU8cowhtvK7g3t7jfKztY7wc8eP?.png"}',
1661333723
);

View File

@@ -69,6 +69,18 @@ fn main() {
sql: include_str!("../migrations/20230420040005_insert_last_login_to_settings.sql"),
kind: MigrationKind::Up,
},
Migration {
version: 20230425023912,
description: "add pubkey to channel",
sql: include_str!("../migrations/20230425023912_add_pubkey_to_channel.sql"),
kind: MigrationKind::Up,
},
Migration {
version: 20230425024708,
description: "add default channels",
sql: include_str!("../migrations/20230425024708_add_default_channels.sql"),
kind: MigrationKind::Up,
},
],
)
.build(),