-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #179 from GSA/feature/95_ART_API
Adding ART Language to Backend
- Loading branch information
Showing
5 changed files
with
112 additions
and
3 deletions.
There are no files selected for viewing
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
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,43 @@ | ||
|
||
module.exports = (sequelize, DataTypes) => { | ||
const ArtLanguage = sequelize.define('ArtLanguage', | ||
{ | ||
id: { | ||
type: DataTypes.INTEGER, | ||
allowNull: false, | ||
primaryKey: true, | ||
autoIncrement:true | ||
}, | ||
solicitation_id: { | ||
type: DataTypes.INTEGER, | ||
allowNull: false, | ||
references: { | ||
model: 'Solicitation', // Name of the referenced table | ||
key: 'id', // Key in the referenced table | ||
} | ||
}, | ||
|
||
language: { | ||
type: DataTypes.JSONB, | ||
allowNull: false | ||
}, | ||
createdAt: { type: DataTypes.DATE, allowNull: false }, | ||
updatedAt: { type: DataTypes.DATE }, | ||
},{ | ||
tableName: 'art_language', | ||
timestamps: true | ||
} | ||
) | ||
|
||
ArtLanguage.associate = function(models) { | ||
// associations can be defined here | ||
ArtLanguage.belongsTo(models.Solicitation, { | ||
foreignKey: 'solicitation_id', | ||
targetKey: 'id', | ||
as: 'solicitation' | ||
}) | ||
|
||
} | ||
|
||
return ArtLanguage; | ||
}; |
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
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
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