WIP - configure list views

This commit is contained in:
Francisco Gaona
2026-01-31 02:46:33 +01:00
parent c7282ee2a0
commit 97fc235636
12 changed files with 1409 additions and 59 deletions

View File

@@ -0,0 +1,25 @@
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.up = function(knex) {
return knex.schema.alterTable('page_layouts', (table) => {
// Add layout_type column to distinguish between detail/edit layouts and list view layouts
// Default to 'detail' for existing layouts
table.enum('layout_type', ['detail', 'list']).notNullable().defaultTo('detail').after('name');
// Update the unique index to include layout_type so we can have both a default detail and default list layout
table.dropIndex(['object_id', 'is_default']);
});
};
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.down = function(knex) {
return knex.schema.alterTable('page_layouts', (table) => {
table.dropColumn('layout_type');
table.index(['object_id', 'is_default']);
});
};