This repository has been archived on 2024-09-20. You can view files and clone it, but cannot push or open issues or pull requests.
musicapp/migrations.moon
2019-04-17 22:08:09 -07:00

27 lines
866 B
Plaintext

import create_table, rename_column, add_column, types from require "lapis.db.schema"
{
[1]: =>
create_table "tracks", {
{ "id", types.serial primary_key: true }
{ "artist", types.text null: true }
{ "name", types.text null: true }
{ "url", types.text null: true }
{ "status", types.integer default: 1 }
}
[2]: =>
rename_column "tracks", "name", "title"
rename_column "tracks", "url", "link"
for column in *{
{ "art_url", types.text null: true }
{ "file_url", types.text null: true }
{ "file_size", types.integer null: true }
{ "album", types.text null: true }
{ "genre", types.text null: true }
{ "tags", types.text default: " untagged " }
{ "quality", types.integer default: 1 }
{ "mood", types.text null: true }
}
add_column "tracks", unpack column
}