fucked up migrations again..
This commit is contained in:
parent
664666441e
commit
aa4b02c195
@ -46,12 +46,14 @@ import Tracks, Tags from require "models"
|
||||
for name, count in pairs tags
|
||||
Tags\create { :name, :count }
|
||||
[6]: =>
|
||||
return true -- formerly a bad migration
|
||||
[7]: =>
|
||||
-- WARNING: removes all tags!
|
||||
for track in *Tracks\select "*"
|
||||
tags = ""
|
||||
for field in *{"artist", "mood", "link", "genre"}
|
||||
if track[field] and #track[field] > 0
|
||||
tags ..= " #{field}:#{track[field]}"
|
||||
tags ..= " #{field}:#{track[field]\gsub "%s+", "_"}"
|
||||
if #tags > 0
|
||||
track.tags = process_tags "untagged" .. tags
|
||||
else
|
||||
|
Reference in New Issue
Block a user