clhq-postgres-module 1.1.0-alpha.172 → 1.1.0-alpha.173

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+ export declare class CreateKlingGenerationTables1713000000004 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateKlingGenerationTables1713000000004 = void 0;
4
+ class CreateKlingGenerationTables1713000000004 {
5
+ constructor() {
6
+ this.name = 'CreateKlingGenerationTables1713000000004';
7
+ }
8
+ async up(queryRunner) {
9
+ await queryRunner.query(`
10
+ CREATE TABLE IF NOT EXISTS kling_generation_jobs (
11
+ id VARCHAR PRIMARY KEY,
12
+ user_id VARCHAR NOT NULL,
13
+ project_id VARCHAR,
14
+ project_title VARCHAR,
15
+ aspect_ratio VARCHAR DEFAULT '16:9',
16
+ status VARCHAR NOT NULL DEFAULT 'pending',
17
+ total_scenes INTEGER DEFAULT 0,
18
+ completed_scenes INTEGER DEFAULT 0,
19
+ failed_scenes INTEGER DEFAULT 0,
20
+ total_duration_seconds INTEGER DEFAULT 0,
21
+ background_music_url TEXT,
22
+ created_at TIMESTAMPTZ DEFAULT NOW(),
23
+ updated_at TIMESTAMPTZ DEFAULT NOW()
24
+ )
25
+ `);
26
+ await queryRunner.query(`
27
+ CREATE TABLE IF NOT EXISTS kling_scene_tasks (
28
+ id VARCHAR PRIMARY KEY,
29
+ job_id VARCHAR NOT NULL REFERENCES kling_generation_jobs(id),
30
+ scene_order INTEGER NOT NULL,
31
+ scene_title VARCHAR,
32
+ prompt TEXT,
33
+ narration TEXT,
34
+ duration_seconds INTEGER,
35
+ style VARCHAR,
36
+ status VARCHAR NOT NULL DEFAULT 'pending',
37
+ progress INTEGER DEFAULT 0,
38
+ kling_task_id VARCHAR,
39
+ output_url TEXT,
40
+ s3_url TEXT,
41
+ voice_audio_url TEXT,
42
+ voice_duration_seconds NUMERIC(6,2),
43
+ kling_submit_request JSONB,
44
+ kling_submit_response JSONB,
45
+ kling_poll_log JSONB DEFAULT '[]'::jsonb,
46
+ error_message TEXT,
47
+ created_at TIMESTAMPTZ DEFAULT NOW(),
48
+ updated_at TIMESTAMPTZ DEFAULT NOW()
49
+ )
50
+ `);
51
+ await queryRunner.query(`
52
+ CREATE INDEX IF NOT EXISTS kling_jobs_user_idx ON kling_generation_jobs (user_id)
53
+ `);
54
+ await queryRunner.query(`
55
+ CREATE INDEX IF NOT EXISTS kling_tasks_job_idx ON kling_scene_tasks (job_id)
56
+ `);
57
+ await queryRunner.query(`
58
+ ALTER TABLE kling_scene_tasks
59
+ ADD COLUMN IF NOT EXISTS voice_audio_url TEXT,
60
+ ADD COLUMN IF NOT EXISTS voice_duration_seconds NUMERIC(6,2)
61
+ `);
62
+ await queryRunner.query(`
63
+ ALTER TABLE kling_generation_jobs
64
+ ADD COLUMN IF NOT EXISTS background_music_url TEXT
65
+ `);
66
+ }
67
+ async down(queryRunner) {
68
+ await queryRunner.query(`DROP INDEX IF EXISTS kling_tasks_job_idx`);
69
+ await queryRunner.query(`DROP INDEX IF EXISTS kling_jobs_user_idx`);
70
+ await queryRunner.query(`DROP TABLE IF EXISTS kling_scene_tasks`);
71
+ await queryRunner.query(`DROP TABLE IF EXISTS kling_generation_jobs`);
72
+ }
73
+ }
74
+ exports.CreateKlingGenerationTables1713000000004 = CreateKlingGenerationTables1713000000004;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clhq-postgres-module",
3
- "version": "1.1.0-alpha.172",
3
+ "version": "1.1.0-alpha.173",
4
4
  "description": "PostgreSQL module using TypeORM for Clippy",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",