@@ -51,64 +51,6 @@ function mixinMigration(PostgreSQL) {
51
51
} ) ;
52
52
} ;
53
53
54
- /*!
55
- * Discover the properties from a table
56
- * @param {String } model The model name
57
- * @param {Function } cb The callback function
58
- */
59
- PostgreSQL . prototype . getTableStatus = function ( model , cb ) {
60
- var fields , indexes ;
61
- var self = this ;
62
-
63
- this . showFields ( model , function ( err , data ) {
64
- if ( err ) return cb ( err ) ;
65
- fields = data ;
66
-
67
- self . showIndexes ( model , function ( err , data ) {
68
- if ( err ) return cb ( err ) ;
69
- indexes = data ;
70
-
71
- if ( fields && indexes )
72
- return cb ( null , fields , indexes ) ;
73
- } ) ;
74
- } ) ;
75
- } ;
76
-
77
- /**
78
- * Perform autoupdate for the given models
79
- * @param {String[] } [models] A model name or an array of model names. If not present, apply to all models
80
- * @callback {Function } [callback] The callback function
81
- * @param {String|Error } err The error string or object
82
- */
83
- PostgreSQL . prototype . autoupdate = function ( models , cb ) {
84
- var self = this ;
85
- if ( ( ! cb ) && ( 'function' === typeof models ) ) {
86
- cb = models ;
87
- models = undefined ;
88
- }
89
- // First argument is a model name
90
- if ( 'string' === typeof models ) {
91
- models = [ models ] ;
92
- }
93
-
94
- models = models || Object . keys ( this . _models ) ;
95
-
96
- async . each ( models , function ( model , done ) {
97
- if ( ! ( model in self . _models ) ) {
98
- return process . nextTick ( function ( ) {
99
- done ( new Error ( g . f ( 'Model not found: %s' + model ) ) ) ;
100
- } ) ;
101
- }
102
- self . getTableStatus ( model , function ( err , fields , indexes ) {
103
- if ( ! err && fields . length ) {
104
- self . alterTable ( model , fields , indexes , done ) ;
105
- } else {
106
- self . createTable ( model , done ) ;
107
- }
108
- } ) ;
109
- } , cb ) ;
110
- } ;
111
-
112
54
/*!
113
55
* Check if the models exist
114
56
* @param {String[] } [models] A model name or an array of model names. If not present, apply to all models
0 commit comments