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

feat: create words table #be

parent 407607d6
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.raw('CREATE EXTENSION IF NOT EXISTS "pgcrypto"');
}
export async function down(knex: Knex): Promise<void> {
return knex.schema.raw('DROP EXTENSION IF EXISTS "pgcrypto"');
}
import { Knex } from "knex";
export async function up(knex: Knex): Promise<void> {
return knex.schema.createTable("words", function (table) {
table.uuid("id").primary().defaultTo(knex.raw("gen_random_uuid()"));
table.string("page_id").index().notNullable();
table.integer("word_id").index().notNullable();
table.unique(["page_id", "word_id"]);
table.binary("image").notNullable();
table.string("ocr_transcript");
table.float("ocr_confidence");
});
}
export async function down(knex: Knex): Promise<void> {
return knex.schema.dropTable("words");
}
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