removing broken code from old migrations

This commit is contained in:
Tangent 2019-06-27 19:28:15 -07:00
parent 0a3c4e6692
commit 664666441e

View File

@ -27,26 +27,9 @@ import Tracks, Tags from require "models"
} }
add_column "tracks", unpack column add_column "tracks", unpack column
[3]: => [3]: =>
-- NOTE: bad migration! (introduces more tags than it should) return true -- formerly a bad migration
for track in *Tracks\select "*"
tags = ""
for field in *{"artist", "mood", "link", "genre"}
if track[field]
tags ..= " #{field}:#{track[field]}"
if #tags > 0
track.tags = process_tags trim(track.tags or "untagged") .. tags
track\update "tags"
[4]: => [4]: =>
-- NOTE: bad migration! (doesn't save changes to database) return true -- formerly a bad migration
for track in *Tracks\select "*"
tags = ""
for field in *{"artist", "mood", "link", "genre"}
if track[field] and #track[field] > 0
tags ..= " #{field}:#{track[field]}"
if #tags > 0
track.tags = process_tags "untagged" .. tags
else
track.tags = " untagged "
[5]: => [5]: =>
create_table "tags", { create_table "tags", {
{ "id", types.serial primary_key: true } { "id", types.serial primary_key: true }