WIP - multitenant initial work

This commit is contained in:
Francisco Gaona
2025-11-29 05:09:00 +01:00
parent 859dca6c84
commit 57f27d28cd
36 changed files with 2784 additions and 36 deletions

View File

@@ -0,0 +1,35 @@
exports.up = function (knex) {
return knex.schema
.createTable('apps', (table) => {
table.uuid('id').primary().defaultTo(knex.raw('(UUID())'));
table.string('slug', 255).notNullable().unique();
table.string('label', 255).notNullable();
table.text('description');
table.integer('displayOrder').defaultTo(0);
table.timestamps(true, true);
table.index(['slug']);
})
.createTable('app_pages', (table) => {
table.uuid('id').primary().defaultTo(knex.raw('(UUID())'));
table.uuid('appId').notNullable();
table.string('slug', 255).notNullable();
table.string('label', 255).notNullable();
table.string('type', 50).notNullable(); // List, Detail, Custom
table.string('objectApiName', 255);
table.integer('displayOrder').defaultTo(0);
table.timestamps(true, true);
table
.foreign('appId')
.references('id')
.inTable('apps')
.onDelete('CASCADE');
table.unique(['appId', 'slug']);
table.index(['appId']);
});
};
exports.down = function (knex) {
return knex.schema.dropTableIfExists('app_pages').dropTableIfExists('apps');
};