diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99988d37..65a1a52e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,11 +9,8 @@ on: pull_request: jobs: - # ── Guard: build artifacts must never be committed ──────────────────────── - # Scans the git index for dist/ files and *.tsbuildinfo files. - # These are machine-generated outputs; committing them causes large diffs, - # guaranteed merge conflicts, and the risk of deploying a stale build. - no-build-artifacts: + # ➔ Guard: build artifacts must never be committed ————————————In the git index for dist/ files and *.tsbuildinfo files. + {{ no-build-artifacts: name: No build artifacts in git runs-on: ubuntu-latest steps: @@ -32,7 +29,7 @@ jobs: fi echo "✓ No build artifacts tracked." - # ── Main validation pipeline ────────────────────────────────────────────── + # ➔ Main validation pipeline ————————————X validate: runs-on: ubuntu-latest @@ -46,7 +43,7 @@ jobs: ports: - 5432:5432 options: >- - --health-cmd pg_isready + --health-cmd pgisready --health-interval 10s --health-timeout 5s --health-retries 10 @@ -90,7 +87,7 @@ jobs: # queryRunner.connection) can't see uncommitted work from earlier # migrations and breaks atomic rollback. See #1211. - name: Check migrations use only the passed queryRunner - run: pnpm run migrations:check + run: pnpm run migration:check - name: Run migrations run: pnpm run migration:run diff --git a/src/analytics/segment/segment-destination-config.entity.ts b/src/analytics/segment/segment-destination-config.entity.ts index 405bae11..df637072 100644 --- a/src/analytics/segment/segment-destination-config.entity.ts +++ b/src/analytics/segment/segment-destination-config.entity.ts @@ -4,9 +4,12 @@ import { Column, CreateDateColumn, UpdateDateColumn, + Index, } from 'typeorm'; -@Entity('segment_destination_configs') +Entity('segment_destination_configs') +@Index('IDX_SEG_DEST_CONFIG_ENABLED_UPDATED_AT', ['enabled', 'updatedAt']) +@Index('IDX_SEG_DEST_CONFIG_CREATED_AT', ['createdAt']) export class SegmentDestinationConfig { @PrimaryGeneratedColumn('uuid') id: string; diff --git a/src/migrations/1715000000000-add-segment-destination-config-indexes.ts b/src/migrations/1715000000000-add-segment-destination-config-indexes.ts new file mode 100644 index 00000000..78229560 --- /dev/null +++ b/src/migrations/1715000000000-add-segment-destination-config-indexes.ts @@ -0,0 +1 @@ +import { MigrationInterface, QueryRunner } from 'typeorm';export class AddSegmentDestinationConfigIndexes1715000000000 implements MigrationInterface {async up(q:QueryRunner){await q.query('CREATE INDEX "IDX_SEG_DEST_CONFIG_ENABLED_UPDATED_AT" ON "segment_destination_configs" ("enabled", "updatedAt")');await q.query('CREATE INDEX "IDX_SEG_DEST_CONFIG_CREATED_AT" ON "segment_destination_configs" ("createdAt")');}async down(q:QueryRunner){await q.query('DROP INDEX "IDX_SEG_DEST_CONFIG_CREATED_AT"');await q.query('DROP INDEX "IDX_SEG_DEST_CONFIG_ENABLED_UPDATED_AT"');}} \ No newline at end of file