Browse Source

fix(gui): Primary key validation

Ignore primary key validation if default value present

closes #346

Signed-off-by: Pranav C <61551451+pranavxc@users.noreply.github.com>
pull/153/head
Pranav C 3 years ago
parent
commit
66bc8f7c15
  1. 2
      packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue
  2. 2
      packages/nocodb/src/example/docker.ts

2
packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue

@ -715,7 +715,7 @@ export default {
}); });
if (this.meta.columns.every((col) => { if (this.meta.columns.every((col) => {
return !col.ai; return !col.ai;
}) && pks.length && pks.every(col => !rowObj[col._cn])) { }) && pks.length && pks.every(col => !rowObj[col._cn] && !(col.columnDefault || col.default))) {
return this.$toast.info('Primary column is empty please provide some value').goAway(3000); return this.$toast.info('Primary column is empty please provide some value').goAway(3000);
} }
if (this.meta.columns.some((col) => { if (this.meta.columns.some((col) => {

2
packages/nocodb/src/example/docker.ts

@ -12,7 +12,7 @@ server.set('view engine', 'ejs');
// process.env[`NC_DB`] = `mysql2://localhost:3306?u=root&p=password&d=mar_21`; // process.env[`NC_DB`] = `mysql2://localhost:3306?u=root&p=password&d=mar_21`;
// process.env[`NC_DB`] = `pg://localhost:3306?u=root&p=password&d=mar_24`; // process.env[`NC_DB`] = `pg://localhost:3306?u=root&p=password&d=mar_24`;
process.env[`NC_DB`] = `pg://localhost:5432?u=postgres&p=xgene&d=abcde`; // process.env[`NC_DB`] = `pg://localhost:5432?u=postgres&p=xgene&d=abcde`;
// process.env[`NC_TRY`] = 'true'; // process.env[`NC_TRY`] = 'true';
// process.env[`NC_DASHBOARD_URL`] = '/test'; // process.env[`NC_DASHBOARD_URL`] = '/test';

Loading…
Cancel
Save