Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/note.picotech.app/public_html/migrations/ drwxr-xr-x | |
| Viewing file: Select action/file-type: 'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up (queryInterface, Sequelize) {
await queryInterface.createTable('audio_chunks', {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
allowNull: false,
},
recording_id: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'recordings',
key: 'id',
},
onDelete: 'CASCADE',
},
chunk_index: {
type: Sequelize.INTEGER,
allowNull: false,
comment: 'Index of the chunk in the sequence (0-based)',
},
file_path: {
type: Sequelize.STRING(500),
allowNull: false,
},
file_name: {
type: Sequelize.STRING(255),
allowNull: false,
},
start_time: {
type: Sequelize.INTEGER,
allowNull: false,
comment: 'Start time in milliseconds from the beginning of the recording',
},
end_time: {
type: Sequelize.INTEGER,
allowNull: false,
comment: 'End time in milliseconds from the beginning of the recording',
},
duration: {
type: Sequelize.INTEGER,
allowNull: false,
comment: 'Duration of this chunk in milliseconds',
},
file_size: {
type: Sequelize.BIGINT,
allowNull: false,
comment: 'File size in bytes',
},
status: {
type: Sequelize.ENUM('pending', 'processing', 'completed', 'failed'),
defaultValue: 'pending',
allowNull: false,
},
transcription_status: {
type: Sequelize.ENUM('pending', 'processing', 'completed', 'failed'),
defaultValue: 'pending',
allowNull: false,
},
error_message: {
type: Sequelize.TEXT,
allowNull: true,
comment: 'Error message if processing failed',
},
checksum: {
type: Sequelize.STRING(64),
allowNull: true,
comment: 'File checksum for integrity verification',
},
created_at: {
type: Sequelize.DATE,
allowNull: false,
},
updated_at: {
type: Sequelize.DATE,
allowNull: false,
},
});
// Add indexes
await queryInterface.addIndex('audio_chunks', ['recording_id']);
await queryInterface.addIndex('audio_chunks', ['recording_id', 'chunk_index'], {
unique: true,
});
await queryInterface.addIndex('audio_chunks', ['status']);
await queryInterface.addIndex('audio_chunks', ['transcription_status']);
},
async down (queryInterface, Sequelize) {
await queryInterface.dropTable('audio_chunks');
}
};
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0047 ]-- |