mirror of
https://github.com/BreizhHardware/Jellystat.git
synced 2026-01-18 16:27:20 +01:00
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
26 lines
689 B
JavaScript
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);
|
|
}
|
|
};
|