mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add bucket, audioFileName, speechMarksFileName, state to speech table
This commit is contained in:
parent
4cf5b934eb
commit
249a5cda4a
3 changed files with 46 additions and 2 deletions
|
|
@ -9,6 +9,13 @@ import {
|
|||
} from 'typeorm'
|
||||
import { User } from './user'
|
||||
|
||||
export enum SpeechState {
|
||||
INITIALIZED = 'INITIALIZED',
|
||||
COMPLETED = 'COMPLETED',
|
||||
FAILED = 'FAILED',
|
||||
CANCELLED = 'CANCELLED',
|
||||
}
|
||||
|
||||
@Entity({ name: 'speech' })
|
||||
export class Speech {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
|
|
@ -22,14 +29,17 @@ export class Speech {
|
|||
elasticPageId!: string
|
||||
|
||||
@Column('text')
|
||||
audioUrl!: string
|
||||
audioFileName!: string
|
||||
|
||||
@Column('text')
|
||||
speechMarksUrl!: string
|
||||
speechMarksFileName!: string
|
||||
|
||||
@Column('text')
|
||||
voice!: string
|
||||
|
||||
@Column('enum', { enum: SpeechState })
|
||||
state!: SpeechState
|
||||
|
||||
@CreateDateColumn({ default: () => 'CURRENT_TIMESTAMP' })
|
||||
createdAt!: Date
|
||||
|
||||
|
|
|
|||
17
packages/db/migrations/0094.do.add_state_to_speech.sql
Executable file
17
packages/db/migrations/0094.do.add_state_to_speech.sql
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
-- Type: DO
|
||||
-- Name: add_state_to_speech
|
||||
-- Description: Add state field to speech table
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TYPE speech_state_type AS ENUM ('INITIALIZED', 'COMPLETED', 'FAILED', 'CANCELLED');
|
||||
|
||||
ALTER TABLE omnivore.speech
|
||||
DROP COLUMN audio_url,
|
||||
DROP COLUMN speech_marks_url,
|
||||
ADD COLUMN bucket VARCHAR(255) NOT NULL DEFAULT '',
|
||||
ADD COLUMN audio_file_name VARCHAR(255) NOT NULL DEFAULT '',
|
||||
ADD COLUMN speech_marks_file_name VARCHAR(255) NOT NULL DEFAULT '',
|
||||
ADD COLUMN state speech_state_type NOT NULL DEFAULT 'INITIALIZED';
|
||||
|
||||
COMMIT;
|
||||
17
packages/db/migrations/0094.undo.add_state_to_speech.sql
Executable file
17
packages/db/migrations/0094.undo.add_state_to_speech.sql
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
-- Type: UNDO
|
||||
-- Name: add_state_to_speech
|
||||
-- Description: Add state field to speech table
|
||||
|
||||
BEGIN;
|
||||
|
||||
DROP TYPE IF EXISTS speech_state_type;
|
||||
|
||||
ALTER TABLE omnivore.speech
|
||||
DROP COLUMN bucket,
|
||||
DROP COLUMN audio_file_name,
|
||||
DROP COLUMN speech_marks_file_name,
|
||||
DROP COLUMN state speech_state_type,
|
||||
ADD COLUMN audio_url text NOT NULL,
|
||||
ADD COLUMN speech_marks_url text NOT NULL;
|
||||
|
||||
COMMIT;
|
||||
Loading…
Reference in a new issue