Skip to content

Commit

Permalink
prisma: ensure that there is at least one migration present - sqlite3…
Browse files Browse the repository at this point in the history
… file (#108)
  • Loading branch information
rubys authored Dec 22, 2024
1 parent 86171a5 commit c8de19c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fly.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ GDF.extend(class extends GDF {
if (fs.existsSync('.github/workflows/deploy.yml')) {
this.flyGitHubPrep()
}

// ensure that there is at least one migration present - sqlite3 file
if (this.prismaSeed && !fs.existsSync(path.join(this._appdir, 'prisma/migrations')) && this.prismaFile && !fs.existsSync(path.join(this._appdir, 'prisma', this.prismaFile)) && fs.existsSync(path.join(this._appdir, 'node_modules'))) {
execSync(`${this.npx} prisma migrate dev --name init`, { stdio: 'inherit' })
}
}

// Verify that fly.toml exists, flyctl is in the path, extract appname
Expand Down

0 comments on commit c8de19c

Please sign in to comment.