Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
oetzit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
commul
oetzit
Commits
cdb23103
Commit
cdb23103
authored
2 years ago
by
Paolo Brasolin
Browse files
Options
Downloads
Patches
Plain Diff
feat: recast and pad word_id
parent
30fe9d26
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
backend/migrations/20220620102600_recast_word_id.ts
+19
-0
19 additions, 0 deletions
backend/migrations/20220620102600_recast_word_id.ts
backend/src/schemas.ts
+2
-1
2 additions, 1 deletion
backend/src/schemas.ts
with
21 additions
and
1 deletion
backend/migrations/20220620102600_recast_word_id.ts
0 → 100644
+
19
−
0
View file @
cdb23103
import
{
Knex
}
from
"
knex
"
;
export
async
function
up
(
knex
:
Knex
):
Promise
<
void
>
{
return
knex
.
schema
.
alterTable
(
"
words
"
,
(
table
)
=>
{
table
.
string
(
"
word_id
"
).
alter
();
})
.
then
(()
=>
{
return
knex
(
"
words
"
).
update
({
word_id
:
knex
.
raw
(
"
LPAD(word_id, 4, '0')
"
),
});
});
}
export
async
function
down
(
knex
:
Knex
):
Promise
<
void
>
{
return
knex
.
schema
.
alterTable
(
"
words
"
,
(
table
)
=>
{
table
.
integer
(
"
word_id
"
).
alter
();
});
}
This diff is collapsed.
Click to expand it.
backend/src/schemas.ts
+
2
−
1
View file @
cdb23103
...
...
@@ -6,7 +6,8 @@ function Nullable<T extends TSchema>(schema: T): TUnion<[T, TNull]> {
export
const
Word
=
Type
.
Object
({
id
:
Type
.
String
({
format
:
"
uuid
"
}),
image
:
Type
.
String
(),
page_id
:
Type
.
String
(),
word_id
:
Type
.
String
(),
ocr_confidence
:
Type
.
Number
({
minimum
:
0
,
maximum
:
1
}),
ocr_transcript
:
Type
.
String
(),
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment