文件
mynode/packages/transcribe/sqlite_queue_migrations/20250322173530_initial_migration.ts
chen 301194963b
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
feat: Initial clean release of CHM
2026-11-04 11:29:39 +08:00

32 行
1004 B
TypeScript

import type { Knex } from 'knex';
export async function up(knex: Knex): Promise<void> {
await knex.schema.createTable('queue', (table) => {
table.string('name').unique().primary().notNullable();
table.datetime('created_on').defaultTo(knex.fn.now());
table.datetime('updated_on').defaultTo(null);
});
await knex.schema.createTable('job', (table) => {
table.uuid('id').unique().primary().notNullable().defaultTo(knex.fn.uuid());
table.string('name').notNullable();
table.jsonb('data');
table.tinyint('state').notNullable().defaultTo(0);
table.tinyint('retry_count').notNullable().defaultTo(0);
table.jsonb('output');
table.datetime('started_on');
table.datetime('completed_on');
table.datetime('created_on').defaultTo(knex.fn.now());
table.datetime('updated_on').defaultTo(null);
table.foreign('name').references('queue.name');
});
}
export async function down(knex: Knex): Promise<void> {
await knex.schema.dropTable('job');
await knex.schema.dropTable('queue');
}