Skip to content

add: support for ARRAY(ENUM) (v3)#8703

Merged
sushantdhiman merged 16 commits intov3from
enum-support
Nov 28, 2017
Merged

add: support for ARRAY(ENUM) (v3)#8703
sushantdhiman merged 16 commits intov3from
enum-support

Conversation

@sushantdhiman
Copy link
Copy Markdown
Contributor

@sushantdhiman sushantdhiman commented Nov 28, 2017

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

Add support for ARRAY(ENUM)

#1498

return Promise.all(promises)
.then(function() {
// fetch OIDs ENUM, refresh them
return self.sequelize.query(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sync will create new enum here, I couldn't find a better place to refresh oids

@sushantdhiman sushantdhiman requested review from a team and mickhansen November 28, 2017 09:47
return this.sequelize.getQueryInterface().pgListEnums(User.getTableName());
}).then(function (enums) {
expect(enums).to.have.length(1);
expect(enums[0].enum_value).to.equal("{view,access,edit,write,check,delete}");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't know if this order would ever be different? Maybe do a substr + split and assert on the array of items

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Order wont change. I ensure you this wont turn into an intermittent failing test :D

});
});

it('should be able to insert new record', function() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add a test that check that you are not able to insert a value that's not part of the eunm

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 28, 2017

Codecov Report

Merging #8703 into v3 will decrease coverage by 0.01%.
The diff coverage is 95.74%.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants