Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz Source: /opt/alga-psa on psa.joliet.tech
59 lines
2.0 KiB
JavaScript
59 lines
2.0 KiB
JavaScript
/**
|
|
* Migration: Create project_task_comments table
|
|
*
|
|
* Creates table for internal-only comments on project tasks with:
|
|
* - BlockNote rich text content with embedded mentions
|
|
* - Author tracking (internal users only)
|
|
* - Cascade delete when task is deleted
|
|
* - CitusDB-compatible primary key
|
|
*/
|
|
|
|
exports.up = function(knex) {
|
|
return knex.schema.createTable('project_task_comments', (table) => {
|
|
// Tenant and primary key
|
|
table.uuid('tenant').notNullable();
|
|
table.uuid('task_comment_id').defaultTo(knex.raw('gen_random_uuid()')).notNullable();
|
|
|
|
// Task reference (REQUIRED - tasks only)
|
|
table.uuid('task_id').notNullable();
|
|
|
|
// User info (internal users only)
|
|
table.uuid('user_id').notNullable();
|
|
table.text('author_type').notNullable().defaultTo('internal');
|
|
|
|
// Content (BlockNote format with embedded mentions)
|
|
table.text('note').notNullable(); // BlockNote JSON
|
|
table.text('markdown_content');
|
|
|
|
// Metadata
|
|
table.timestamp('created_at').defaultTo(knex.fn.now()).notNullable();
|
|
table.timestamp('updated_at');
|
|
table.timestamp('edited_at');
|
|
|
|
// Primary key (includes tenant for CitusDB)
|
|
table.primary(['task_comment_id', 'tenant']);
|
|
|
|
// Foreign keys
|
|
table.foreign('tenant').references('tenants.tenant');
|
|
table.foreign(['tenant', 'task_id'])
|
|
.references(['tenant', 'task_id'])
|
|
.inTable('project_tasks')
|
|
.onDelete('CASCADE');
|
|
table.foreign(['tenant', 'user_id'])
|
|
.references(['tenant', 'user_id'])
|
|
.inTable('users');
|
|
|
|
// Check constraint - only internal users
|
|
table.check('?? = ?', ['author_type', 'internal']);
|
|
|
|
// Indexes for performance
|
|
table.index(['tenant', 'task_id'], 'idx_project_task_comments_tenant_task');
|
|
table.index(['tenant', 'user_id'], 'idx_project_task_comments_user');
|
|
table.index(['tenant', 'created_at'], 'idx_project_task_comments_created');
|
|
});
|
|
};
|
|
|
|
exports.down = function(knex) {
|
|
return knex.schema.dropTableIfExists('project_task_comments');
|
|
};
|