Wappler Version : 6.7.1
Operating System : win 11
Server Model: node
Database Type: MySQL (cloud vioa docker)
Hosting Type: local
Expected behavior
Field type uuid should be created
Actual behavior
Knex error displayed
How to reproduce
I have a simple table
i add a field of type UUID WHICH IS NOT TO BE USED AS PRIMARY KEY, checkbox is not checked
and apply changes
Update fails
Looks like it is trying to make the field a primary key even though "Primary" checkbox is not checked.
Clue is in
Knex code
exports.up = function(knex) {
return knex.schema
.raw(knex.client.constructor.name.startsWith('Client_PG') ? 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp"' : 'SELECT 1')
.table('testtable', async function (table) {
table.uuid('myuuidfield').primary().defaultTo(knex.client.constructor.name.startsWith('Client_PG') ? knex.raw('uuid_generate_v4()')
: (knex.client.constructor.name.includes('MSSQL') ? knex.raw('NEWID()')
: (knex.client.constructor.name.includes('MySQL') ? knex.raw('(UUID())') : null)));
})
};
exports.down = function(knex) {
return knex.schema
.table('testtable', async function (table) {
table.dropColumn('myuuidfield');
})
};
``