27 lines
866 B
Plaintext
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
|
|
}
|