initial work for smarter database cleanup
This commit is contained in:
parent
de3decbffd
commit
d0b83babd2
5 changed files with 93 additions and 6 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue