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
|
for name, count in pairs tags
|
||||||
Tags\create { :name, :count }
|
Tags\create { :name, :count }
|
||||||
[6]: =>
|
[6]: =>
|
||||||
|
return true -- formerly a bad migration
|
||||||
|
[7]: =>
|
||||||
-- WARNING: removes all tags!
|
-- WARNING: removes all tags!
|
||||||
for track in *Tracks\select "*"
|
for track in *Tracks\select "*"
|
||||||
tags = ""
|
tags = ""
|
||||||
for field in *{"artist", "mood", "link", "genre"}
|
for field in *{"artist", "mood", "link", "genre"}
|
||||||
if track[field] and #track[field] > 0
|
if track[field] and #track[field] > 0
|
||||||
tags ..= " #{field}:#{track[field]}"
|
tags ..= " #{field}:#{track[field]\gsub "%s+", "_"}"
|
||||||
if #tags > 0
|
if #tags > 0
|
||||||
track.tags = process_tags "untagged" .. tags
|
track.tags = process_tags "untagged" .. tags
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user