Lists list and CUD

Custom forms list
Updated DB schema (not yet implemented in the server, which means that most of the server is not broken).
- custom forms are independent of a list
- order and visibility of fields is now in custom_fields
- first_name and last_name has been turned to a regular custom field
This commit is contained in:
Tomas Bures 2017-07-29 22:42:07 +03:00
parent 216fe40b53
commit f6e1938ff9
47 changed files with 1245 additions and 122 deletions

View file

@ -1,8 +1,6 @@
exports.up = function(knex, Promise) {
const entityTypesAddNamespace = ['list', 'report', 'report_template', 'user'];
let schema = knex.schema;
schema = schema.createTable('namespaces', table => {
const entityTypesAddNamespace = ['list', 'custom_form', 'report', 'report_template', 'user'];
let promise = knex.schema.createTable('namespaces', table => {
table.increments('id').primary();
table.string('name');
table.text('description');
@ -10,12 +8,12 @@ exports.up = function(knex, Promise) {
})
.then(() => knex('namespaces').insert({
id: 1, /* Global namespace id */
name: 'Global',
description: 'Global namespace'
name: 'Root',
description: 'Root namespace'
}));
for (const entityType of entityTypesAddNamespace) {
schema = schema
promise = promise
.then(() => knex.schema.table(`${entityType}s`, table => {
table.integer('namespace').unsigned().notNullable();
}))
@ -27,7 +25,7 @@ exports.up = function(knex, Promise) {
}));
}
return schema;
return promise;
};
exports.down = function(knex, Promise) {