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