Closed thejollyrogers closed 10 years ago
I’ll pull this down in a little bit and test it out.
running an unknown migrate command causes a hang:
➜ stellar-wallet git:(master) ✗ stex migrate create
[Error: Unknown cmd create]
The above command never exits.
Looks like successful commands dont properly exit as well
Given the migration (in stellar-wallet) (using npm-linked stex):
'use strict';
exports.up = function(knex, Promise) {
knex.schema.table('wallets_v2', function (table) {
table.string('publicKey').index();
});
};
exports.down = function(knex, Promise) {
};
I get the following output:
➜ stellar-wallet git:(master) ✗ stex migrate latest
SQL: select * from information_schema.tables where table_schema = ? and table_name = ?
SQL: create table `knex_migrations` (`id` int unsigned not null auto_increment primary key, `name` varchar(255), `batch` int, `migration_time` timestamp)
SQL: select `name` from `knex_migrations` order by `id` asc
SQL: select max(`batch`) as `batchNo` from `knex_migrations`
Possibly unhandled TypeError: Object [object Knex:mysql] has no method 'createTable'
at Object.exports.up (/Users/nullstyle/Dropbox/src/stellar/stellar-wallet/migrations/20140604193141-add-wallets.js:5:6)
at Object.current.then.then.knex.insert.name (/Users/nullstyle/Dropbox/src/stellar/stex/node_modules/knex/lib/migrate/index.js:214:34)
at tryCatch1 (/Users/nullstyle/Dropbox/src/stellar/stex/node_modules/knex/node_modules/bluebird/js/main/util.js:63:19)
at Promise$_callHandler [as _callHandler] (/Users/nullstyle/Dropbox/src/stellar/stex/node_modules/knex/node_modules/bluebird/js/main/promise.js:695:13)
at Promise$_settlePromiseFromHandler [as _settlePromiseFromHandler] (/Users/nullstyle/Dropbox/src/stellar/stex/node_modules/knex/node_modules/bluebird/js/main/promise.js:711:18)
at Promise$_settlePromiseAt [as _settlePromiseAt] (/Users/nullstyle/Dropbox/src/stellar/stex/node_modules/knex/node_modules/bluebird/js/main/promise.js:868:14)
at Async$_consumeFunctionBuffer [as _consumeFunctionBuffer] (/Users/nullstyle/Dropbox/src/stellar/stex/node_modules/knex/node_modules/bluebird/js/main/async.js:74:12)
at Async$consumeFunctionBuffer (/Users/nullstyle/Dropbox/src/stellar/stex/node_modules/knex/node_modules/bluebird/js/main/async.js:37:14)
at process._tickDomainCallback (node.js:463:13)
I added the finally block to shutdown stex after the command runs, are you sure it's hanging?
I'll check it again later today
not sure why you're getting a "has no method 'createTable'" when you don't ever call that method in your example migration..you sure it's not running a different migration file?
scoot :+1:
add knex migration support to stex