Initial db migrations (forgor in last PR) #3

merged
opened by lewis.moe targeting main

Forgor to git add -N the migration files in last PR sorry!

+5
.env.example
···
+
# shitsky saves state here
+
DATABASE_URL=postgres://postgres:postgres@localhost:5432/shitsky
+
+
# shitsky is only going to care about the social circles of the users in these PDSes:
+
PDS_LIST=pds.witchcraft.systems,pds.upcloud.world
+1
.gitignore
···
/target
/.sqlx
+
.env
+1
migrations/20251004130559_create_firehose_table.down.sql
···
+
DROP TABLE firehose_messages;
+4
migrations/20251004130559_create_firehose_table.up.sql
···
+
CREATE TABLE firehose_messages (
+
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
+
message JSONB NOT NULL
+
);
+1 -1
src/firehose.rs
···
break;
},
Ok(Some(Ok(msg))) => {
-
if let Message::Binary(data) = msg {
+
if let Message::Binary(data) = msg {
let mut deserializer = serde_ipld_dagcbor::de::Deserializer::from_slice(&data);
let map_cbor_err = |e: serde_ipld_dagcbor::DecodeError<std::convert::Infallible>| {
std::io::Error::other(e.to_string())
+1 -1
src/main.rs
···
tracing::info!("Starting firehose subscriber...");
let options = FirehoseOptions {
-
relay_url: "wss://relay.upcloud.world".to_string(),
+
relay_url: "wss://bsky.network".to_string(),
..Default::default()
};