Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const cli = async () => {
if (!dbi || "Sequelize" !== dbi.constructor.name) {
throw new Error("Sequelize export not found")
}
const schemaPath = join(process.cwd(), "migrations/schema.json")
const schemaPath = join(process.cwd(), process.env.SEQ_MM_SCHEMA_PATH || "migrations/schema.json")
if (existsSync(schemaPath)) {
const oldSchema = require(schemaPath)
await makemigration(dbi, oldSchema)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
},
"devDependencies": {
"@types/inquirer": "^9.0.2",
"@types/node": "^20.11.19",
"@types/prompts": "^2.4.1",
"@types/sequelize": "^4.28.14",
"sequelize": "^6.25.3",
Expand Down
4 changes: 2 additions & 2 deletions src/compareSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ export const compareSchema = async (
.toString()
.padStart(2, "0")}-${migName}`
await fs.writeFile(
`./migrations/${name}.js`,
`./${process.env.SEQ_MM_MIGRATIONS_PATH || 'migrations'}/${name}.js`,
script.replaceAll(`"%%`, "").replaceAll(`%%"`, "").replaceAll("\\", "")
)
await fs.writeFile(`./migrations/schema.json`, saveCurrent)
await fs.writeFile(`./${process.env.SEQ_MM_SCHEMA_PATH || 'migrations/schema.json'}`, saveCurrent)
}