How to use the migrate/lib/log.error function in migrate

To help you get started, we’ve selected a few migrate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ExpressGateway / express-gateway / migrations / 1510050700766-index-applications.js View on Github external
                return db.sadd(appNameSetKey, app.id).catch((err) => log.error('Key existing', err)); // Try to add the missing index
              });
github ExpressGateway / express-gateway / migrations / 1509389756098-credential-username-userid-transform.js View on Github external
                    .catch(err => log.error('Credential existing already', err)) // Create a new one with the ID instead of the username
                  )
github deluan / contentful-migrate / lib / bootstrap / createFile.js View on Github external
mkdirp(directory, (makeDirectoryError) => {
      if (makeDirectoryError) {
        reject(logError(`🚨  Failed to create ${directory}`, makeDirectoryError))
      }

      // Fix up file path
      const date = dateformat(new Date(), 'UTC:yyyymmddHHMMss')
      const fileName = `${date}-create-${camelToDash(contentTypeId)}.js`
      const filePath = path.join(process.cwd(), directory, fileName)

      // Write the template file
      return fs.writeFile(filePath, fileContent, (writeFileError) => {
        if (writeFileError) {
          reject(logError(`🚨  Failed to create ${directory}/${fileName}`, writeFileError))
        }
        log('Created', `${directory}/${fileName}`)
        resolve({ contentTypeId, fileName })
      })
    })
github deluan / contentful-migrate / bin / commands / up.js View on Github external
.catch((err) => {
      log.error('error', err)
      console.log(chalk.bold.red(`\n🚨  Error applying migrations to "${environmentId}" environment! See above for error messages`))
      process.exit(1)
    })
}
github deluan / contentful-migrate / bin / commands / down.js View on Github external
.catch((err) => {
      log.error('error', err)
      process.exit(1)
    }))
}
github deluan / contentful-migrate / bin / commands / list.js View on Github external
.catch((err) => {
      log.error('error', err)
      process.exit(1)
    }))
}
github deluan / contentful-migrate / lib / bootstrap / deleteScripts.js View on Github external
return rimraf(contentTypeDirectory, (error) => {
          if (error) {
            reject(logError(`🚨   Failed to delete migrations/${contentType} folder`, error))
          }
          resolve(log(`migrations/${contentType} folder`, 'deleted'))
        })
      })
github deluan / contentful-migrate / lib / bootstrap.js View on Github external
spaceId,
  environmentId,
  contentTypes,
  accessToken,
  migrationsDirectory,
  writeMigrationState
) => {
  try {
    await deleteScripts(migrationsDirectory, contentTypes)
    const files = await generateScripts(spaceId, environmentId, contentTypes, accessToken, migrationsDirectory)
    if (writeMigrationState) {
      rewriteMigration(spaceId, environmentId, accessToken, files)
    }
    log(chalk.bold.green('🎉  Bootstrap'), chalk.bold.green('successful'))
  } catch (error) {
    logError('🚨  Failed to perform bootstrap', error)
  }
}
github deluan / contentful-migrate / lib / bootstrap / createFile.js View on Github external
return fs.writeFile(filePath, fileContent, (writeFileError) => {
        if (writeFileError) {
          reject(logError(`🚨  Failed to create ${directory}/${fileName}`, writeFileError))
        }
        log('Created', `${directory}/${fileName}`)
        resolve({ contentTypeId, fileName })
      })
    })
github deluan / contentful-migrate / lib / bootstrap / deleteScripts.js View on Github external
return rimraf(migrationsDirectory, (error) => {
      if (error) {
        reject(logError('🚨   Failed to delete migrations folder', error))
      }
      resolve(log('Migrations folder', 'deleted'))
    })
  })

migrate

Abstract migration framework for node

MIT
Latest version published 3 months ago

Package Health Score

75 / 100
Full package analysis