mirror of
https://github.com/knex/knex.git
synced 2025-12-30 00:30:14 +00:00
parent
f264b1ae38
commit
2c3b4ded7b
@ -113,6 +113,10 @@ Object.assign(ColumnCompiler_MySQL.prototype, {
|
||||
return 'json';
|
||||
},
|
||||
|
||||
jsonb() {
|
||||
return 'json';
|
||||
},
|
||||
|
||||
// Modifiers
|
||||
// ------
|
||||
|
||||
|
||||
@ -66,19 +66,29 @@ module.exports = function(dialect) {
|
||||
);
|
||||
});
|
||||
|
||||
if (dialect !== 'maria') {
|
||||
it('adding json', function() {
|
||||
tableSql = client
|
||||
.schemaBuilder()
|
||||
.table('user', function(t) {
|
||||
t.json('preferences');
|
||||
})
|
||||
.toSQL();
|
||||
expect(tableSql[0].sql).to.equal(
|
||||
'alter table `user` add `preferences` json'
|
||||
);
|
||||
});
|
||||
}
|
||||
it('adding json', function() {
|
||||
tableSql = client
|
||||
.schemaBuilder()
|
||||
.table('user', function(t) {
|
||||
t.json('preferences');
|
||||
})
|
||||
.toSQL();
|
||||
expect(tableSql[0].sql).to.equal(
|
||||
'alter table `user` add `preferences` json'
|
||||
);
|
||||
});
|
||||
|
||||
it('adding jsonb', function() {
|
||||
tableSql = client
|
||||
.schemaBuilder()
|
||||
.table('user', function(t) {
|
||||
t.jsonb('preferences');
|
||||
})
|
||||
.toSQL();
|
||||
expect(tableSql[0].sql).to.equal(
|
||||
'alter table `user` add `preferences` json'
|
||||
);
|
||||
});
|
||||
|
||||
it('test drop table', function() {
|
||||
tableSql = client
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user