Add "recordings" table, save raw audio blobs in it
Other changes: - Move Stored(Voicemail|Recording) interfaces into knex/types/tables module for reduced boilerplate. - Change updateStoredVoicemail to take Partial<StoredVoicemail>, allowing to only update only some columns
This commit is contained in:
13
src/db/migrations/20210311061107_create_audio_table.ts
Normal file
13
src/db/migrations/20210311061107_create_audio_table.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { Knex } from "knex";
|
||||
|
||||
export async function up(knex: Knex) {
|
||||
await knex.schema.createTable("recordings", (table) => {
|
||||
table.bigInteger("messageId").primary().references("voicemails.messageId");
|
||||
table.string("mimeType", 32);
|
||||
table.binary("audio");
|
||||
});
|
||||
}
|
||||
|
||||
export async function down(knex: Knex) {
|
||||
await knex.schema.dropTable("recordings");
|
||||
}
|
Reference in New Issue
Block a user