Files
Jellystat/backend/migrations/094_jf_library_items_table_add_genres.js
CyferShepard 607b21c542 Added Genre stats to users page #292
Added Genres to items table
enhanced db-helper to add group by
fixed bug in fb-helper where null rows triggered a not count prop error
fixed issue where no plays on user screen attempted to open the item page
updated translations for genres
2025-03-30 17:33:58 +02:00

26 lines
689 B
JavaScript

exports.up = async function (knex) {
try {
const hasTable = await knex.schema.hasTable("jf_library_items");
if (hasTable) {
await knex.schema.alterTable("jf_library_items", function (table) {
table.jsonb("Genres").defaultTo(JSON.stringify([]));
});
}
} catch (error) {
console.error(error);
}
};
exports.down = async function (knex) {
try {
const hasTable = await knex.schema.hasTable("jf_library_items");
if (hasTable) {
await knex.schema.alterTable("jf_library_items", function (table) {
table.dropColumn("Genres"); // Drop the column during rollback
});
}
} catch (error) {
console.error(error);
}
};