@topolo/cli 0.6.5 → 0.6.7

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.
@@ -483,7 +483,9 @@ function emitBindings(lines, bindings, env) {
483
483
  lines.push(`binding = ${tomlString(d.binding)}`);
484
484
  lines.push(`database_name = ${tomlString(cfg.databaseName)}`);
485
485
  if (cfg.databaseId) lines.push(`database_id = ${tomlString(cfg.databaseId)}`);
486
- if (d.migrationsDir) lines.push(`migrations_dir = ${tomlString(d.migrationsDir)}`);
486
+ if (d.manageMigrations !== false && d.migrationsDir) {
487
+ lines.push(`migrations_dir = ${tomlString(d.migrationsDir)}`);
488
+ }
487
489
  lines.push('');
488
490
  }
489
491
  for (const r of bindings.r2 || []) {
@@ -656,7 +658,11 @@ function emitCloudcontrol() {
656
658
  const reportedHost = host || publicUrlHost(t, env);
657
659
  const reportedRoutes = routes.length ? routes : (host ? [host] : []);
658
660
  const d1Migrations = (t.bindings?.d1 || [])
659
- .filter((binding) => bindingAppliesToEnv(binding, env) && binding[env])
661
+ .filter((binding) => (
662
+ bindingAppliesToEnv(binding, env)
663
+ && binding[env]
664
+ && binding.manageMigrations !== false
665
+ ))
660
666
  .map((binding) => ({
661
667
  binding: binding.binding,
662
668
  ...(binding.migrationsDir || binding.migrations_dir
@@ -687,7 +693,7 @@ function emitCloudcontrol() {
687
693
  ...(Array.isArray(t.requiredSecrets) && t.requiredSecrets.length
688
694
  ? { required_secrets: t.requiredSecrets }
689
695
  : {}),
690
- ...(d1Migrations.length ? { migrations: { d1: d1Migrations } } : {}),
696
+ ...(t.bindings?.d1?.length ? { migrations: { d1: d1Migrations } } : {}),
691
697
  ...preservedCloudControlFields,
692
698
  });
693
699
  }