Skip to content

Conversation

ssh24
Copy link
Contributor

@ssh24 ssh24 commented May 3, 2017

Description

connect to #250

Related issues

  • None

Checklist

  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style
    guide

@ssh24 ssh24 force-pushed the fix/explicit-numeric-datatype branch 3 times, most recently from 496ceae to 7014197 Compare May 4, 2017 02:18
@ssh24 ssh24 force-pushed the fix/explicit-numeric-datatype branch from 7014197 to 7ebfb98 Compare May 4, 2017 02:20
lib/migration.js Outdated
return colDefault ? (' DEFAULT ' + colDefault) : '';
};

// override this function from base connector to allow postgres
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to allow postgres connector to

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


it('should run migration', function(done) {
db.automigrate('PostWithBoolean', function() {
db.automigrate(['PostWithBoolean', 'Expense'], function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does PostWithBoolean do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostWithBoolean is another model attached to the same datasource. It was already there before for other tests. I only added the Expense model.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, yeah!

@ssh24 ssh24 force-pushed the fix/explicit-numeric-datatype branch from 8fc50a8 to 60fb48a Compare May 4, 2017 14:34
lib/migration.js Outdated
return null;
}
var colLength = columnMetadata && columnMetadata.dataLength ||
prop.length || prop.limit;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be indented one level?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@ssh24 ssh24 force-pushed the fix/explicit-numeric-datatype branch from 60fb48a to 9fe7aaa Compare May 4, 2017 15:10
lib/migration.js Outdated
// info on setting column specific properties
// i.e dataLength, dataPrecision, dataScale
// https://loopback.io/doc/en/lb3/Model-definition-JSON-file.html
if (colType && colLength)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would refactor this since colType is a common condition:

if(colType) {
if (colLength) {
// return ..
}
if ( colPrecision && colScale) {
// return ...
}
}

@ssh24 ssh24 force-pushed the fix/explicit-numeric-datatype branch from ba5e80a to a463388 Compare May 4, 2017 15:45
Copy link
Contributor

@loay loay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ssh24 ssh24 merged commit 81939cf into master May 4, 2017
@ssh24 ssh24 deleted the fix/explicit-numeric-datatype branch May 4, 2017 15:56
kjdelisle pushed a commit that referenced this pull request May 15, 2017
 * Add docker setup (#256) (Sakib Hasan)
 * Allow explicit numeric datatype (#254) (Sakib Hasan)
 * Allow non-id serial properties (#198) (zbarbuto)
 * Revert PR #246 (#248) (Sakib Hasan)
 * Add loopback-connector as peer dependencies (#246) (Russ Tyndall)
 * Fix operations on ended transactions (zbarbuto)
 * dbdefaults: Cleanup InvalidDefault def after test (Kevin Delisle)
 * Reuse the data source to avoid too many clients (Raymond Feng)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants