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 {
return {
step: 1,
tableInsert: {
skipHeader: false,
skipHeader: true,
nullElement: null,
delimiter: null,
csvLocation: null
......@@ -163,11 +163,9 @@ export default {
},
computed: {
step1Valid () {
return this.tableName !== null
return this.tableCreate.name !== null && this.tableCreate.name.length > 0
}
},
mounted () {
},
methods: {
async upload () {
this.loading = true
......@@ -206,6 +204,11 @@ export default {
async createTable () {
/* make enum values to array */
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) {
return
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment