Created
August 6, 2013 06:40
-
-
Save dxg/6162564 to your computer and use it in GitHub Desktop.
mysql mediumtext
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
}); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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