mirror of
				https://github.com/nkanaev/yarr.git
				synced 2025-10-30 22:43:29 +00:00 
			
		
		
		
	drop description field usage
This commit is contained in:
		| @@ -84,7 +84,7 @@ func (s *Storage) CreateItems(items []Item) bool { | ||||
| 				content, image, podcast_url, | ||||
| 				date_arrived, status | ||||
| 			) | ||||
| 			values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) | ||||
| 			values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) | ||||
| 			on conflict (feed_id, guid) do nothing`, | ||||
| 			item.GUID, item.FeedId, item.Title, item.Link, item.Date, | ||||
| 			item.Content, item.ImageURL, item.AudioURL, | ||||
|   | ||||
| @@ -11,6 +11,7 @@ var migrations = []func(*sql.Tx) error{ | ||||
| 	m02_feed_states_and_errors, | ||||
| 	m03_on_delete_actions, | ||||
| 	m04_item_podcasturl, | ||||
| 	m05_move_description_to_content, | ||||
| } | ||||
|  | ||||
| var maxVersion = int64(len(migrations)) | ||||
| @@ -242,3 +243,11 @@ func m04_item_podcasturl(tx *sql.Tx) error { | ||||
| } | ||||
|  | ||||
| // TODO: description -> content | ||||
| func m05_move_description_to_content(tx *sql.Tx) error { | ||||
| 	sql := ` | ||||
| 		update items set content=description | ||||
| 		where length(content) = 0 or content is null | ||||
| 	` | ||||
| 	_, err := tx.Exec(sql) | ||||
| 	return err | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user