Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

803 B
Raw Blame
import { addColumnIfMissing } from '../migration-utils';
import { Migration } from '@mikro-orm/migrations';

/**
 * Legacy migration step 130 (`db/migrations.ts`).
 *
 * Migration: OAuth 2.0 client_credentials grant — allow user-owned confidential
 * clients to skip the browser consent flow entirely and obtain tokens directly
 * via client_id + client_secret. Flag is immutable after creation so existing
 * authorization-code clients are not silently upgraded.
 */
export class Migration20200101021000_oauth_2 extends Migration {
  override name = 'Migration20200101021000_oauth_2';

  override async up(): Promise<void> {
    await addColumnIfMissing(
      this,
      'oauth_clients',
      'allows_client_credentials',
      `allows_client_credentials INTEGER NOT NULL DEFAULT 0`,
    );
  }
}