A social RSS reader built on the AT Protocol. glean.at
glean atproto atmosphere rss feed social app
14
fork

Configure Feed

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

Refactor migrations to specify columns explicitly

+11 -7
+11 -7
internal/db/migrations.go
··· 105 105 error_count INTEGER NOT NULL DEFAULT 0, 106 106 favicon_url TEXT 107 107 )`, 108 - `INSERT INTO articles.feeds_new SELECT * FROM articles.feeds`, 108 + `INSERT INTO articles.feeds_new (feed_url, title, site_url, description, feed_type, last_fetched_at, last_error, subscriber_count, consecutive_empty_fetches, error_count, favicon_url) 109 + SELECT feed_url, title, site_url, description, feed_type, last_fetched_at, last_error, subscriber_count, consecutive_empty_fetches, error_count, favicon_url FROM articles.feeds`, 109 110 `DROP TABLE articles.feeds`, 110 111 `ALTER TABLE articles.feeds_new RENAME TO feeds`, 111 112 } { ··· 119 120 120 121 func migrateAddPersonTargetType(db *DB) error { 121 122 for _, m := range []struct { 122 - table string 123 - create string 124 - index string 123 + table string 124 + create string 125 + columns string 126 + index string 125 127 }{ 126 128 { 127 129 table: "dismissed_recommendations", ··· 133 135 dismissed_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, 134 136 PRIMARY KEY (user_did, target_type, target_id) 135 137 )`, 136 - index: "idx_dismissed_user_type", 138 + columns: "user_did, target_type, target_id, reason, dismissed_at", 139 + index: "idx_dismissed_user_type", 137 140 }, 138 141 { 139 142 table: "recommendation_impressions", ··· 147 150 acted BOOLEAN NOT NULL DEFAULT 0, 148 151 PRIMARY KEY (user_did, target_type, target_id) 149 152 )`, 150 - index: "idx_impressions_user_unacted", 153 + columns: "user_did, target_type, target_id, first_shown_at, last_shown_at, shown_count, acted", 154 + index: "idx_impressions_user_unacted", 151 155 }, 152 156 } { 153 157 var schema string ··· 160 164 161 165 for _, stmt := range []string{ 162 166 m.create, 163 - fmt.Sprintf("INSERT INTO %s_new SELECT * FROM %s", m.table, m.table), 167 + fmt.Sprintf("INSERT INTO %s_new (%s) SELECT %s FROM %s", m.table, m.columns, m.columns, m.table), 164 168 fmt.Sprintf("DROP TABLE %s", m.table), 165 169 fmt.Sprintf("ALTER TABLE %s_new RENAME TO %s", m.table, m.table), 166 170 fmt.Sprintf("CREATE INDEX IF NOT EXISTS %s ON %s(user_did, target_type)", m.index, m.table),