Skip to content

Commit

Permalink
Adds Bigint scaffold test (redwoodjs#4226)
Browse files Browse the repository at this point in the history
Co-authored-by: David Price <[email protected]>
  • Loading branch information
dthyresson and thedavidprice authored Jan 21, 2022
1 parent 2e6184e commit f08881d
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,23 @@ const PostForm = (props) => {
<FieldError name=\\"metadata\\" className=\\"rw-field-error\\" />
<Label
name=\\"hugeNumber\\"
className=\\"rw-label\\"
errorClassName=\\"rw-label rw-label-error\\"
>
Huge number
</Label>
<TextField
name=\\"hugeNumber\\"
defaultValue={props.post?.hugeNumber}
className=\\"rw-input\\"
errorClassName=\\"rw-input rw-input-error\\"
validation={{ required: true }}
/>
<FieldError name=\\"hugeNumber\\" className=\\"rw-field-error\\" />
<div className=\\"rw-button-group\\">
<Submit disabled={props.loading} className=\\"rw-button rw-button-blue\\">
Save
Expand Down Expand Up @@ -344,6 +361,7 @@ export const QUERY = gql\`
rating
postedAt
metadata
hugeNumber
}
}
\`
Expand Down Expand Up @@ -466,6 +484,10 @@ const Post = ({ post }) => {
<th>Metadata</th>
<td>{jsonDisplay(post.metadata)}</td>
</tr>
<tr>
<th>Huge number</th>
<td>{post.hugeNumber}</td>
</tr>
</tbody>
</table>
</div>
Expand Down Expand Up @@ -949,6 +971,7 @@ export const QUERY = gql\`
rating
postedAt
metadata
hugeNumber
}
}
\`
Expand Down Expand Up @@ -1054,6 +1077,7 @@ const PostsList = ({ posts }) => {
<th>Rating</th>
<th>Posted at</th>
<th>Metadata</th>
<th>Huge number</th>
<th>&nbsp;</th>
</tr>
</thead>
Expand All @@ -1071,6 +1095,7 @@ const PostsList = ({ posts }) => {
<td>{truncate(post.rating)}</td>
<td>{timeTag(post.postedAt)}</td>
<td>{jsonTruncate(post.metadata)}</td>
<td>{truncate(post.hugeNumber)}</td>
<td>
<nav className=\\"rw-table-actions\\">
<Link
Expand Down Expand Up @@ -1316,6 +1341,22 @@ const PostForm = (props) => {
/>
<FieldError name=\\"metadata\\" className=\\"rw-field-error\\" />
<Label
name=\\"hugeNumber\\"
className=\\"rw-label\\"
errorClassName=\\"rw-label rw-label-error\\"
>
Huge number
</Label>
<TextField
name=\\"hugeNumber\\"
defaultValue={props.post?.hugeNumber}
className=\\"rw-input\\"
errorClassName=\\"rw-input rw-input-error\\"
validation={{ required: true }}
/>
<FieldError name=\\"hugeNumber\\" className=\\"rw-field-error\\" />
<div className=\\"rw-button-group\\">
<Submit
disabled={props.loading}
Expand Down Expand Up @@ -1460,6 +1501,7 @@ export const QUERY = gql\`
rating
postedAt
metadata
hugeNumber
}
}
\`
Expand Down Expand Up @@ -1569,6 +1611,9 @@ const Post = ({ post }) => {
</tr><tr>
<th>Metadata</th>
<td>{jsonDisplay(post.metadata)}</td>
</tr><tr>
<th>Huge number</th>
<td>{post.hugeNumber}</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -1985,6 +2030,7 @@ export const QUERY = gql\`
rating
postedAt
metadata
hugeNumber
}
}
\`
Expand All @@ -2002,6 +2048,7 @@ const UPDATE_POST_MUTATION = gql\`
rating
postedAt
metadata
hugeNumber
}
}
\`
Expand Down Expand Up @@ -2128,6 +2175,7 @@ export const QUERY = gql\`
rating
postedAt
metadata
hugeNumber
}
}
\`
Expand Down Expand Up @@ -2236,6 +2284,7 @@ const PostsList = ({ posts }) => {
<th>Rating</th>
<th>Posted at</th>
<th>Metadata</th>
<th>Huge number</th>
<th>&nbsp;</th>
</tr>
</thead>
Expand All @@ -2253,6 +2302,7 @@ const PostsList = ({ posts }) => {
<td>{truncate(post.rating)}</td>
<td>{timeTag(post.postedAt)}</td>
<td>{jsonTruncate(post.metadata)}</td>
<td>{truncate(post.hugeNumber)}</td>
<td>
<nav className=\\"rw-table-actions\\">
<Link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@ generator client {
// migrations for them.

model Post {
id Int @id @default(autoincrement())
title String
slug String @unique
author String
body String
image String?
isPinned Boolean @default(false)
readTime Int
rating Float?
postedAt DateTime?
metadata Json
favorites Favorite[]
id Int @id @default(autoincrement())
title String
slug String @unique
author String
body String
image String?
isPinned Boolean @default(false)
readTime Int
rating Float?
postedAt DateTime?
metadata Json
hugeNumber BigInt @default(9007199254740992)
favorites Favorite[]
}

model User {
Expand Down

0 comments on commit f08881d

Please sign in to comment.