Skip to content

Commit 2ecfcd6

Browse files
authored
[MSFNW26] Setup Sequlize (#19)
* MSFNW26-setup-sequlize * update readme to include migration instruction * fix lint * fix lint
1 parent d8b637e commit 2ecfcd6

File tree

8 files changed

+4621
-504
lines changed

8 files changed

+4621
-504
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ Detailed instructions can be found here: [Technical Onboarding](https://www.noti
3333
touch .env
3434
```
3535

36+
## Creating Migration
37+
```node migrate create --name my-migration.ts --folder migrations```
38+
3639
## Authors
3740

3841
Erica Han

backend/.sequelizerc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
'config': path.resolve('config', 'config.js'),
5+
'models-path': path.resolve('models'),
6+
'seeders-path': path.resolve('seeders'),
7+
'migrations-path': path.resolve('migrations')
8+
};

backend/migrate.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* eslint-disable @typescript-eslint/no-require-imports */
2+
require('dotenv').config();
3+
require('ts-node/register');
4+
5+
require('./umzug').migrator.runAsCLI();

0 commit comments

Comments
 (0)