import type { MigrationDefinition } from './types.js';

/**
 * Migration registry — ordered list of all migrations.
 * Add new migrations to the end of this array.
 *
 * Each migration must be idempotent (safe to re-run).
 */
export const MIGRATIONS: MigrationDefinition[] = [
  // Example migration — uncomment and adapt when first real migration is needed:
  // {
  //   version: 1,
  //   name: '001_add_productId_to_legacy_users',
  //   description: 'Backfill productId field on users created before multi-product support',
  //   reversible: true,
  //   up: async () => {
  //     const { getContainer } = await import('../lib/cosmos.js');
  //     const users = getContainer('users');
  //     const { resources } = await users.items
  //       .query({ query: "SELECT * FROM c WHERE NOT IS_DEFINED(c.productId)" })
  //       .fetchAll();
  //     for (const user of resources) {
  //       user.productId = 'lysnrai';
  //       await users.item(user.id, user.id).replace(user);
  //     }
  //   },
  // },
];
