this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

correct table name

+6 -6
+6 -6
database.go
··· 76 76 return nil 77 77 } 78 78 79 - func createSubscriptionTable(db *sql.DB) error { 80 - createSubscriptionTableSQL := `CREATE TABLE IF NOT EXISTS subscriptions ( 79 + func createSubscriptionTables(db *sql.DB) error { 80 + createSubscriptionsTableSQL := `CREATE TABLE IF NOT EXISTS subscriptions ( 81 81 "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, 82 82 "parentURI" TEXT, 83 83 "userDID" TEXT, ··· 85 85 );` 86 86 87 87 slog.Info("Create subscriptions table...") 88 - statement, err := db.Prepare(createSubscriptionTableSQL) 88 + statement, err := db.Prepare(createSubscriptionsTableSQL) 89 89 if err != nil { 90 90 return fmt.Errorf("prepare DB statement to create subscriptions table: %w", err) 91 91 } ··· 93 93 if err != nil { 94 94 return fmt.Errorf("exec sql statement to create subscriptions table: %w", err) 95 95 } 96 - slog.Info("feed subscriptions created") 96 + slog.Info("subscriptions table created") 97 97 98 98 return nil 99 99 } ··· 141 141 } 142 142 143 143 func getSubscriptionsForParent(db *sql.DB, parentURI string) ([]string, error) { 144 - sql := "SELECT id, parentURI, userDID FROM subscription WHERE parentURI = ?" 144 + sql := "SELECT id, parentURI, userDID FROM subscriptions WHERE parentURI = ?" 145 145 rows, err := db.Query(sql, parentURI) 146 146 if err != nil { 147 147 return nil, fmt.Errorf("run query to get subscriptions: %w", err) ··· 164 164 sql := `INSERT INTO subscriptions (parentURI, userDID,) VALUES (?, ?);` 165 165 _, err := db.Exec(sql, parentURI, userDid) 166 166 if err != nil { 167 - return fmt.Errorf("exec insert subscrption: %w", err) 167 + return fmt.Errorf("exec insert subscrptions: %w", err) 168 168 } 169 169 return nil 170 170 }