Permalink
Browse files

tests for MySQL lowercasing table names bug

  • Loading branch information...
1 parent eaecab4 commit 2ac29da2678896c2a2981e3fe798fe29761c6cb5 @noazark noazark committed Sep 27, 2013
Showing with 20 additions and 3 deletions.
  1. +20 −3 test/driver/mysql_test.js
View
@@ -320,16 +320,33 @@ driver.connect({ driver: 'mysql', database: 'db_migrate_test', user:'root' }, fu
}).addBatch({
'addIndex': {
topic: function() {
- db.createTable('event', {
+ db.createTable('Event', {
id: { type: dataType.INTEGER, primaryKey: true, autoIncrement: true },
title: { type: dataType.STRING }
}, function() {
- db.addIndex('event', 'event_title', 'title', this.callback.bind(this, null));
+ db.addIndex('Event', 'event_title', 'title', this.callback.bind(this, null));
}.bind(this));
},
teardown: function() {
- db.dropTable('event', this.callback);
+ db.dropTable('Event', this.callback);
+ },
+
+ 'preserves case': {
+ topic: function() {
+ dbmeta('mysql', { connection:db.connection}, function (err, meta) {
+ if (err) {
+ return this.callback(err);
+ }
+ meta.getTables(this.callback);
+ }.bind(this));
+ },
+
+ 'of the functions original table': function(err, tables) {
+ assert.isNotNull(tables);
+ assert.equal(tables.length, 1);
+ assert.equal(tables[0].getName(), 'Event');
+ }
},
'has resulting index metadata': {

0 comments on commit 2ac29da

Please sign in to comment.