Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Cleanup indices. #68

Merged
merged 1 commit into from
Jun 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 6 additions & 41 deletions models/CopilotPayment.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,64 +21,29 @@ const schema = new Schema({
required: true
},
project: {
type: String,
index: {
global: true,
rangeKey: 'id',
project: true,
name: 'ProjectIndex'
}
type: String
},
amount: {type: Number, required: true},
description: {type: String, required: true},
challengeId: {
type: Number,
required: false,
index: {
global: true,
rangeKey: 'id',
project: true,
name: 'ChallengeIdIndex'
}
required: false
},
challengeUUID: {
type: String,
required: false,
index: {
global: true,
project: true,
name: 'ChallengeUUIdIndex'
}
required: false
},
closed: {
type: String,
required: true,
default: 'false',
index: {
global: true,
rangeKey: 'id',
project: true,
name: 'ClosedIndex'
}
default: 'false'
},
username: {
type: String,
required: true,
index: {
global: true,
rangeKey: 'id',
project: true,
name: 'UsernameIndex'
}
required: true
},
status: {
type: String,
index: {
global: true,
rangeKey: 'id',
project: true,
name: 'StatusIndex'
}
type: String
}
});

Expand Down
16 changes: 2 additions & 14 deletions models/Issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,14 @@ const schema = new Schema({
// From the receiver service
number: {
type: Number,
required: true,
index: {
global: true,
rangeKey: 'id',
project: true,
name: 'NumberIndex'
}
required: true
},
title: {type: String, required: true},
body: {type: String},
prizes: {type: [Number], required: true}, // extracted from title
provider: {
type: String,
required: true,
index: {
global: true,
rangeKey: 'id',
project: true,
name: 'ProviderIndex'
}
required: true
}, // github or gitlab
repositoryId: {
type: Number,
Expand Down
24 changes: 3 additions & 21 deletions models/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ const schema = new Schema({
},
userProviderId: {
type: Number,
required: true,
index: {
global: true,
rangeKey: 'id',
project: true,
name: 'UsesProviderIdIndex'
}
required: true
},
userProviderIdStr: {
type: String,
Expand All @@ -45,24 +39,12 @@ const schema = new Schema({
role: {
type: String,
required: true,
enum: _.values(constants.USER_ROLES),
index: {
global: true,
project: true,
name: 'RoleIndex',
rangeKey: 'id'
}
enum: _.values(constants.USER_ROLES)
},
type: {
type: String,
required: true,
enum: _.values(constants.USER_TYPES),
index: {
global: true,
rangeKey: 'id',
name: 'TypeIndex',
project: true
}
enum: _.values(constants.USER_TYPES)
},
// gitlab token data
accessToken: {type: String, required: false},
Expand Down