This is the template project that's checked out and configured when you run the bando-up command from ljsthw-bandolier. This is where the code really lives.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bandolier-template/migrations/20211111034030_media_meta_f...

32 lines
1.0 KiB

exports.up = async (knex) => {
return knex.schema.alterTable('media', (table) => {
table.string("title");
table.string("tags").notNullable().default("");
table.integer("views").default(0);
table.string("description");
table.string("codec_name", 20);
table.integer("width").notNullable().default(0);
table.integer("height").notNullable().default(0);
table.float("duration").notNullable().default(0.0);
table.enum("state", ["new", "edited", "published"]).defaultTo("new");
table.string("aspect_ratio", 10).notNullable().default("16/9");
table.unique("src");
});
}
exports.down = async (knex) => {
return knex.schema.alterTable('media', (table) => {
table.dropColumn("title");
table.dropColumn("tags");
table.dropColumn("views");
table.dropColumn("description");
table.dropColumn("codec_name");
table.dropColumn("width");
table.dropColumn("height");
table.dropColumn("duration");
table.dropColumn("state");
table.dropColumn("aspect_ratio");
table.dropUnique("src");
});
}