mirror of
https://github.com/nkanaev/yarr.git
synced 2025-11-07 18:09:36 +00:00
initial work for smarter database cleanup
This commit is contained in:
@@ -13,6 +13,7 @@ var migrations = []func(*sql.Tx) error{
|
||||
m04_item_podcasturl,
|
||||
m05_move_description_to_content,
|
||||
m06_fill_missing_dates,
|
||||
m07_add_feed_size,
|
||||
}
|
||||
|
||||
var maxVersion = int64(len(migrations))
|
||||
@@ -259,3 +260,14 @@ func m06_fill_missing_dates(tx *sql.Tx) error {
|
||||
_, err := tx.Exec(sql)
|
||||
return err
|
||||
}
|
||||
|
||||
func m07_add_feed_size(tx *sql.Tx) error {
|
||||
sql := `
|
||||
create table if not exists feed_sizes (
|
||||
feed_id references feeds(id) unique,
|
||||
size integer not null default 0
|
||||
);
|
||||
`
|
||||
_, err := tx.Exec(sql)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user