-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return from migrations, remove granteeId from index
Renamed migrations to ensure they are ran
- Loading branch information
1 parent
e96c77d
commit f9914ca
Showing
6 changed files
with
86 additions
and
94 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
42 changes: 0 additions & 42 deletions
42
src/migrations/20210305181122-create-activity-report-objectives.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
up: async (queryInterface) => queryInterface.addIndex('GrantGoals', ['grantId', 'goalId'], { unique: true }), | ||
|
||
down: async (queryInterface) => queryInterface.removeIndex('GrantGoals', ['grantId', 'goalId']), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
module.exports = { | ||
up: async (queryInterface, Sequelize) => queryInterface.createTable('Objectives', { | ||
id: { | ||
type: Sequelize.INTEGER, | ||
allowNull: false, | ||
primaryKey: true, | ||
autoIncrement: true, | ||
}, | ||
goalId: { | ||
type: Sequelize.INTEGER, | ||
allowNull: false, | ||
references: { | ||
model: { | ||
tableName: 'Goals', | ||
}, | ||
key: 'id', | ||
}, | ||
}, | ||
title: { | ||
type: Sequelize.TEXT, | ||
}, | ||
ttaProvided: { | ||
type: Sequelize.TEXT, | ||
}, | ||
status: { | ||
type: Sequelize.STRING, | ||
}, | ||
createdAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE, | ||
defaultValue: Sequelize.fn('NOW'), | ||
}, | ||
updatedAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE, | ||
defaultValue: Sequelize.fn('NOW'), | ||
}, | ||
}), | ||
|
||
down: (queryInterface) => queryInterface.dropTable('Objectives'), | ||
}; |
40 changes: 40 additions & 0 deletions
40
src/migrations/20210310181122-create-activity-report-objectives.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module.exports = { | ||
up: async (queryInterface, Sequelize) => queryInterface.createTable('ActivityReportObjectives', { | ||
id: { | ||
type: Sequelize.INTEGER, | ||
allowNull: false, | ||
primaryKey: true, | ||
autoIncrement: true, | ||
}, | ||
activityReportId: { | ||
type: Sequelize.INTEGER, | ||
allowNull: false, | ||
references: { | ||
model: { | ||
tableName: 'ActivityReports', | ||
}, | ||
}, | ||
}, | ||
objectiveId: { | ||
type: Sequelize.INTEGER, | ||
allowNull: false, | ||
references: { | ||
model: { | ||
tableName: 'Objectives', | ||
}, | ||
}, | ||
}, | ||
createdAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE, | ||
defaultValue: Sequelize.fn('NOW'), | ||
}, | ||
updatedAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE, | ||
defaultValue: Sequelize.fn('NOW'), | ||
}, | ||
}), | ||
|
||
down: (queryInterface) => queryInterface.dropTable('ActivityReportObjectives'), | ||
}; |