Skip to content

Commit 76b57d9

Browse files
authored
Merge pull request #29 from bradymholt/cp-migration
Use a cross-platform friendly create migration script
2 parents 081c425 + f628900 commit 76b57d9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"pretest:client": "./node_modules/typescript/bin/tsc -p ./client-react.test/",
1111
"test:client": "mocha --require ignore-styles --recursive client-react.test/build/client-react.test",
1212
"test": "npm run test:api && npm run test:client",
13-
"migrate": "cd ./api/ && dotnet ef migrations add $(date +%s) && dotnet ef database update",
13+
"migrate": "cd ./api/ && node ../scripts/create-migration.js && dotnet ef database update",
1414
"prestart": "docker-compose up -d",
1515
"start": "cd ./api && cross-env NODE_PATH=../node_modules/ ASPNETCORE_ENVIRONMENT=Development dotnet watch run",
1616
"start:release": "npm run prerelease && cd ./api/bin/Release/netcoreapp1.0/publish/ && dotnet api.dll",

scripts/create-migration.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const timestamp = Math.floor(new Date().getTime()/1000).toString();
2+
const execSync = require("child_process").execSync;
3+
execSync(`dotnet ef migrations add ${timestamp}`);

0 commit comments

Comments
 (0)