Skip to content

Instantly share code, notes, and snippets.

@dxg
Created August 6, 2013 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dxg/6162564 to your computer and use it in GitHub Desktop.
Save dxg/6162564 to your computer and use it in GitHub Desktop.
mysql mediumtext
var _ = require('lodash');
var should = require('should');
var helper = require('../support/spec_helper');
var async = require('async');
var ORM = require('../../');
describe("abc", function() {
var db = null;
var Person = null;
var setup = function () {
return function (done) {
Person = db.define("person", {
name: { type: 'text', size: 67000 },
label: { type: 'text' },
height: { type: 'number' }
});
return helper.dropSync(Person, done);
};
};
before(function (done) {
helper.connect(function (connection) {
db = connection;
done();
});
});
before(setup(false, false));
after(function () {
db.close();
});
it("should work", function(done) {
var john = new Person({name: 'fdhdjendfjkdfhshdfhakdfjajhfdjhbfgk'});
john.save(function (err) {
console.log("saved");
return done();
});
});
});
(orm/mysql) DROP TABLE IF EXISTS `person`
(orm/mysql) CREATE TABLE IF NOT EXISTS `person` (`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(67000), `label` VARCHAR(255), `height` FLOAT, PRIMARY KEY (`id`))
◦ should work: (orm/mysql) INSERT INTO `person` (`name`, `label`, `height`) VALUES ('fdhdjendfjkdfhshdfhakdfjajhfdjhbfgk', NULL, NULL)
SHOW CREATE TABLE person;
| Table | Create Table
| person | CREATE TABLE `person` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` mediumtext,
`label` varchar(255) DEFAULT NULL,
`height` float DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment