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-website/migrations/20211111034030_media_meta_f...

31 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");
});
}