Skip to content
Snippets Groups Projects
Verified Commit bb44853f authored by Kirill Stytsenko's avatar Kirill Stytsenko
Browse files

Ensure `id` column is a PrimaryKey

parent d7aa9db9
No related branches found
No related tags found
3 merge requests!81New stable release,!43Merge dev to master,!33Draft: merge dev to master
...@@ -135,7 +135,7 @@ export default { ...@@ -135,7 +135,7 @@ export default {
return { return {
step: 1, step: 1,
tableInsert: { tableInsert: {
skipHeader: false, skipHeader: true,
nullElement: null, nullElement: null,
delimiter: null, delimiter: null,
csvLocation: null csvLocation: null
...@@ -163,11 +163,9 @@ export default { ...@@ -163,11 +163,9 @@ export default {
}, },
computed: { computed: {
step1Valid () { step1Valid () {
return this.tableName !== null return this.tableCreate.name !== null && this.tableCreate.name.length > 0
} }
}, },
mounted () {
},
methods: { methods: {
async upload () { async upload () {
this.loading = true this.loading = true
...@@ -206,6 +204,11 @@ export default { ...@@ -206,6 +204,11 @@ export default {
async createTable () { async createTable () {
/* make enum values to array */ /* make enum values to array */
this.tableCreate.columns.forEach((column) => { this.tableCreate.columns.forEach((column) => {
// validate `id` column: must be a PK
if (column.name === 'id' && (!column.primaryKey)) {
this.$toast.error('Column `id` has to be a Primary Key')
return
}
if (column.enumValues == null) { if (column.enumValues == null) {
return return
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment