Skip to content
Snippets Groups Projects
Commit cdb23103 authored by Paolo Brasolin's avatar Paolo Brasolin
Browse files

feat: recast and pad word_id

parent 30fe9d26
No related branches found
No related tags found
No related merge requests found
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();
});
}
......@@ -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(),
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment