fix: resource advanced view filter.

This commit is contained in:
Ahmed Bouhuolia
2020-09-16 21:41:09 +02:00
parent a22c8395f3
commit ca92c925a9
72 changed files with 997 additions and 2324 deletions

View File

@@ -1,11 +0,0 @@
exports.up = function (knex) {
return knex.schema.createTable('resources', (table) => {
table.increments();
table.string('name');
});
};
exports.down = function (knex) {
return knex.schema.dropTable('resources');
};

View File

@@ -1,21 +0,0 @@
exports.up = function (knex) {
return knex.schema.createTable('resource_fields', (table) => {
table.increments();
table.string('label_name');
table.string('key');
table.string('data_type');
table.string('help_text');
table.string('default');
table.boolean('active');
table.boolean('predefined');
table.boolean('builtin').defaultTo(false);
table.boolean('columnable');
table.integer('index');
table.string('data_resource');
table.json('options');
table.integer('resource_id').unsigned();
}).raw('ALTER TABLE `RESOURCE_FIELDS` AUTO_INCREMENT = 1000');
};
exports.down = (knex) => knex.schema.dropTableIfExists('resource_fields');

View File

@@ -3,7 +3,7 @@ exports.up = function (knex) {
return knex.schema.createTable('view_has_columns', (table) => {
table.increments();
table.integer('view_id').unsigned();
table.integer('field_id').unsigned();
table.string('field_key');
table.integer('index').unsigned();
}).raw('ALTER TABLE `ITEMS_CATEGORIES` AUTO_INCREMENT = 1000');
};

View File

@@ -0,0 +1,13 @@
exports.up = function (knex) {
return knex.schema.createTable('view_roles', (table) => {
table.increments();
table.integer('index');
table.string('field_key');
table.string('comparator');
table.string('value');
table.integer('view_id').unsigned();
}).raw('ALTER TABLE `VIEW_ROLES` AUTO_INCREMENT = 1000');
};
exports.down = (knex) => knex.schema.dropTableIfExists('view_roles');

View File

@@ -4,7 +4,7 @@ exports.up = function (knex) {
table.increments();
table.string('name');
table.boolean('predefined');
table.integer('resource_id').unsigned().references('id').inTable('resources');
table.string('resource_model');
table.boolean('favourite');
table.string('roles_logic_expression');
table.timestamps();

View File

@@ -1,14 +0,0 @@
exports.up = function(knex) {
return knex.schema.createTable('resource_custom_fields_metadata', (table) => {
table.increments();
table.integer('resource_id').unsigned();
table.integer('resource_item_id').unsigned();
table.string('key');
table.string('value');
});
};
exports.down = function(knex) {
return knex.schema.dropTableIfExists('resource_custom_fields_metadata');
};