-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We've tested the lexicon with the two partner organizations. The metadata fields may change in the future but not dramatically. For reference: - Annotation guideline (for meaning of each label): https://docs.google.com/document/d/18H4TlLFB2GXK054oMj1uXVJ2OCFW08Gi/edit - partner annotations here: https://docs.google.com/spreadsheets/d/15YrV8Q-5PTorHRo71ZBkdL0bePPaUNC9FTU41ET91V4/edit#gid=0 These are the fields that we need for now: | Field Name | Field Type | Possible Values | Optional?| | ------------- | ---------- |----------------- |------- | | Level of Severity | Single option | low, mid, high | No | | Casual | Binary | Yes, No | No | | Appropriated | Binary | Yes, No | No | | If, Appropriated is it by community or others? | Binary | Community, Others | yes | | What makes it problematic? | Text | | yes | | Category of Abuse | pick multiple | gendered, sexualized, religion, ethnicity , political affiliation, caste, class, body shaming, abelist, sexual identity, other | pick at least one, at most 4 | --------- Co-authored-by: Denny <[email protected]>
- Loading branch information
1 parent
64c0b84
commit d4ee30d
Showing
34 changed files
with
4,255 additions
and
155 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
browser-extension/api-server/db/migrations/20230906084000-create-slur.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,51 @@ | ||
'use strict'; | ||
module.exports = { | ||
up: async (queryInterface, Sequelize) => { | ||
await queryInterface.createTable('slurs', { | ||
id: { | ||
allowNull: false, | ||
primaryKey: true, | ||
type: Sequelize.UUID, | ||
defaultValue: Sequelize.UUIDV4, | ||
}, | ||
userId: { | ||
type: Sequelize.UUID, | ||
defaultValue: Sequelize.UUIDV4, | ||
references: { | ||
model:'users', | ||
key: 'id', | ||
} | ||
}, | ||
label: { | ||
type: Sequelize.STRING, | ||
}, | ||
levelOfSeverity : { | ||
type: Sequelize.ENUM(['low', 'medium', 'high']), | ||
}, | ||
casual : { | ||
type: Sequelize.BOOLEAN, | ||
}, | ||
appropriated: { | ||
type: Sequelize.BOOLEAN, | ||
}, | ||
appropriationContext: { | ||
type: Sequelize.BOOLEAN, | ||
}, | ||
labelMeaning: { | ||
type: Sequelize.TEXT, | ||
}, | ||
createdAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE, | ||
}, | ||
updatedAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE, | ||
}, | ||
}); | ||
}, | ||
|
||
down: async (queryInterface, Sequelize) => { | ||
await queryInterface.dropTable('slurs'); | ||
}, | ||
}; |
48 changes: 48 additions & 0 deletions
48
browser-extension/api-server/db/migrations/20230906085000-create-category.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,48 @@ | ||
'use strict'; | ||
module.exports = { | ||
up: async (queryInterface, Sequelize) => { | ||
await queryInterface.createTable('categories', { | ||
id: { | ||
allowNull: false, | ||
primaryKey: true, | ||
type: Sequelize.UUID, | ||
defaultValue: Sequelize.UUIDV4, | ||
}, | ||
slurId: { | ||
type: Sequelize.UUID, | ||
defaultValue: Sequelize.UUIDV4, | ||
references: { | ||
model: 'slurs', | ||
key: 'id', | ||
}, | ||
}, | ||
category: { | ||
type: Sequelize.ENUM([ | ||
"gendered", | ||
"sexualized", | ||
"religion", | ||
"ethnicity", | ||
"political affiliation", | ||
"caste", | ||
"class", | ||
"body shaming", | ||
"ableist", | ||
"sexual identity", | ||
"other", | ||
]), | ||
}, | ||
createdAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE, | ||
}, | ||
updatedAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE, | ||
}, | ||
}); | ||
}, | ||
|
||
down: async (queryInterface, Sequelize) => { | ||
await queryInterface.dropTable('categories'); | ||
}, | ||
}; |
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,47 @@ | ||
"use strict"; | ||
const { Model } = require("sequelize"); | ||
|
||
module.exports = (sequelize, DataTypes) => { | ||
class category extends Model { | ||
static associate(models) { | ||
// Define associations here if needed | ||
} | ||
} | ||
|
||
category.init( | ||
{ | ||
id: { | ||
primaryKey: true, | ||
type: DataTypes.UUID, | ||
defaultValue: DataTypes.UUIDV4, | ||
}, | ||
slurId: { | ||
type: DataTypes.UUID, | ||
defaultValue: DataTypes.UUIDV4, | ||
foreignKey: true, | ||
allowNull: false, | ||
}, | ||
category: { | ||
type: DataTypes.ENUM([ | ||
"gendered", | ||
"sexualized", | ||
"religion", | ||
"ethnicity", | ||
"political affiliation", | ||
"caste", | ||
"class", | ||
"body shaming", | ||
"ableist", | ||
"sexual identity", | ||
"other", | ||
]), | ||
}, | ||
}, | ||
{ | ||
sequelize, | ||
modelName: "category", | ||
} | ||
); | ||
|
||
return category; | ||
}; |
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,59 @@ | ||
"use strict"; | ||
const { Model } = require("sequelize"); | ||
|
||
module.exports = (sequelize, DataTypes) => { | ||
class slur extends Model { | ||
/** | ||
* Helper method for defining associations. | ||
* This method is not a part of Sequelize lifecycle. | ||
* The `models/index` file will call this method automatically. | ||
*/ | ||
static associate(models) { | ||
// Define associations here if needed | ||
slur.hasMany(models.category, { | ||
foreignKey: "slurId", | ||
as: "categories", | ||
}); | ||
} | ||
} | ||
|
||
slur.init( | ||
{ | ||
id: { | ||
primaryKey: true, | ||
type: DataTypes.UUID, | ||
defaultValue: DataTypes.UUIDV4, | ||
}, | ||
userId: { | ||
type: DataTypes.UUID, | ||
defaultValue: DataTypes.UUIDV4, | ||
foreignKey: true, | ||
allowNull: false, | ||
}, | ||
label: { | ||
type: DataTypes.STRING, | ||
}, | ||
levelOfSeverity: { | ||
type: DataTypes.ENUM(['low', 'medium', 'high']), | ||
}, | ||
casual: { | ||
type: DataTypes.BOOLEAN, | ||
}, | ||
appropriated: { | ||
type: DataTypes.BOOLEAN, | ||
}, | ||
appropriationContext: { | ||
type: DataTypes.BOOLEAN, | ||
}, | ||
labelMeaning: { | ||
type: DataTypes.TEXT, | ||
}, | ||
}, | ||
{ | ||
sequelize, | ||
modelName: "slur", | ||
} | ||
); | ||
|
||
return slur; | ||
}; |
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
Oops, something went wrong.