updating code using knex.
This commit is contained in:
27
migrations/20250302021618_initial_tables.ts
Normal file
27
migrations/20250302021618_initial_tables.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import type { Knex } from "knex";
|
||||
|
||||
|
||||
export async function up(knex: Knex): Promise<void> {
|
||||
await knex.schema.createTable("settings", (table) => {
|
||||
table.string("host_language");
|
||||
table.string("libretranslate_base_url");
|
||||
table.integer("ui_direction");
|
||||
table.string("whisper_model");
|
||||
});
|
||||
|
||||
await knex.schema.createTable("whisper_models", (table) => {
|
||||
table.string("model");
|
||||
table.boolean("download_status");
|
||||
table.integer("expected_size");
|
||||
table.text("last_hash"),
|
||||
table.string("bytes_done");
|
||||
table.string("bytes_total");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export async function down(knex: Knex): Promise<void> {
|
||||
await knex.schema.dropTable("whisper_models");
|
||||
await knex.schema.dropTable("settings");
|
||||
}
|
||||
|
Reference in New Issue
Block a user