Set User table name and fix test for migrations

This commit is contained in:
Anatoliy Chakkaev 2013-02-16 23:09:20 +08:00
parent b15aa88681
commit ec6d6e7572
1 changed files with 7 additions and 6 deletions

View File

@ -24,6 +24,7 @@ User = schema.define 'User',
, indexes: , indexes:
index1: index1:
columns: 'email, createdByAdmin' columns: 'email, createdByAdmin'
table: 'user'
withBlankDatabase = (cb) -> withBlankDatabase = (cb) ->
db = schema.settings.database = DBNAME db = schema.settings.database = DBNAME
@ -119,8 +120,8 @@ it 'should run migration', (test) ->
# Once gain, getIdexes truncates multi-key indexes to the first member. Hence index1 is correct. # Once gain, getIdexes truncates multi-key indexes to the first member. Hence index1 is correct.
getIndexes 'User', (err, fields) -> getIndexes 'User', (err, fields) ->
test.deepEqual fields, test.deepEqual fields,
PRIMARY: PRIMARY:
Table: 'User' Table: 'user'
Non_unique: 0 Non_unique: 0
Key_name: 'PRIMARY' Key_name: 'PRIMARY'
Seq_in_index: 1 Seq_in_index: 1
@ -133,8 +134,8 @@ it 'should run migration', (test) ->
Index_type: 'BTREE' Index_type: 'BTREE'
Comment: '' Comment: ''
Index_comment: '' Index_comment: ''
email: email:
Table: 'User' Table: 'user'
Non_unique: 1 Non_unique: 1
Key_name: 'email' Key_name: 'email'
Seq_in_index: 1 Seq_in_index: 1
@ -147,8 +148,8 @@ it 'should run migration', (test) ->
Index_type: 'BTREE' Index_type: 'BTREE'
Comment: '' Comment: ''
Index_comment: '' Index_comment: ''
index1: index1:
Table: 'User' Table: 'user'
Non_unique: 1 Non_unique: 1
Key_name: 'index1' Key_name: 'index1'
Seq_in_index: 1 Seq_in_index: 1