Skip to content

Parse.Schema required fields and defaultValues #961

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Oct 16, 2019
Merged

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Oct 16, 2019

Closes: #930

Requires Parse Server 3.7.0+

Feature: parse-community/parse-server#5835

I added a FieldOption to addField and its counter parts. This will allow for future options like uppercase / lowercase for example.

Closes: #930

Requires Parse Server 3.7.0+

Feature: parse-community/parse-server#5835

I added a FieldOption to addField and its counter parts. This will allow for future options like uppercase / lowercase for example.

I keep getting a schema mismatch when I use dates and pointers. @davimacedo Maybe you know why?
@codecov
Copy link

codecov bot commented Oct 16, 2019

Codecov Report

Merging #961 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #961      +/-   ##
==========================================
+ Coverage    91.9%   91.94%   +0.04%     
==========================================
  Files          54       54              
  Lines        5063     5077      +14     
  Branches     1134     1142       +8     
==========================================
+ Hits         4653     4668      +15     
+ Misses        410      409       -1
Impacted Files Coverage Δ
src/ParseSchema.js 100% <100%> (ø) ⬆️
src/ParseFile.js 96.72% <0%> (+0.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41db1dc...f379f13. Read the comment docs.

@dplewis
Copy link
Member Author

dplewis commented Oct 16, 2019

@acinader @davimacedo How does this look?

Copy link
Contributor

@acinader acinader left a comment

Choose a reason for hiding this comment

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

lgtm.

@@ -69,6 +83,30 @@ describe('ParseSchema', () => {
done();
});

it('can create schema fields required and default values', (done) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

since this doesn't require any async, you could remove the done from the func declaration and remove the end done().

@dplewis dplewis merged commit 7ff9f92 into master Oct 16, 2019
@dplewis dplewis deleted the schema-defaultValue branch October 16, 2019 22:06
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.

How to set required and defaultValue in Schema?
2 participants