}
},
{
+ indexes: [
+ {
+ fields: [ 'name' ]
+ },
+ {
+ fields: [ 'podId' ]
+ }
+ ],
classMethods: {
associate
}
}
},
{
+ indexes: [
+ {
+ fields: [ 'clientId' ],
+ unique: true
+ },
+ {
+ fields: [ 'clientId', 'clientSecret' ],
+ unique: true
+ }
+ ],
classMethods: {
- associate,
-
getByIdAndSecret,
list,
loadFirstClient
// ---------------------------------------------------------------------------
-function associate (models) {
- this.hasMany(models.OAuthToken, {
- foreignKey: {
- name: 'oAuthClientId',
- allowNull: false
- },
- onDelete: 'cascade'
- })
-}
-
function list (callback) {
return this.findAll().asCallback(callback)
}
}
},
{
+ indexes: [
+ {
+ fields: [ 'refreshToken' ],
+ unique: true
+ },
+ {
+ fields: [ 'accessToken' ],
+ unique: true
+ },
+ {
+ fields: [ 'userId' ]
+ },
+ {
+ fields: [ 'oAuthClientId' ]
+ }
+ ],
classMethods: {
associate,
},
onDelete: 'cascade'
})
+
+ this.belongsTo(models.OAuthClient, {
+ foreignKey: {
+ name: 'oAuthClientId',
+ allowNull: false
+ },
+ onDelete: 'cascade'
+ })
}
function getByRefreshTokenAndPopulateClient (refreshToken) {
}
},
{
+ indexes: [
+ {
+ fields: [ 'host' ]
+ },
+ {
+ fields: [ 'score' ]
+ }
+ ],
classMethods: {
associate,
module.exports = function (sequelize, DataTypes) {
const RequestToPod = sequelize.define('RequestToPod', {}, {
+ indexes: [
+ {
+ fields: [ 'requestId' ]
+ },
+ {
+ fields: [ 'podId' ]
+ },
+ {
+ fields: [ 'requestId', 'podId' ],
+ unique: true
+ }
+ ],
classMethods: {
removePodOf
}
}
},
{
+ timestamps: false,
+ indexes: [
+ {
+ fields: [ 'name' ],
+ unique: true
+ }
+ ],
classMethods: {
associate
}
}
},
{
+ indexes: [
+ {
+ fields: [ 'username' ]
+ }
+ ],
classMethods: {
associate,
}
},
{
+ indexes: [
+ {
+ fields: [ 'authorId' ]
+ },
+ {
+ fields: [ 'remoteId' ]
+ },
+ {
+ fields: [ 'name' ]
+ },
+ {
+ fields: [ 'createdAt' ]
+ },
+ {
+ fields: [ 'duration' ]
+ },
+ {
+ fields: [ 'infoHash' ]
+ }
+ ],
classMethods: {
associate,
// ---------------------------------------------------------------------------
module.exports = function (sequelize, DataTypes) {
- const VideoTag = sequelize.define('VideoTag', {}, {})
+ const VideoTag = sequelize.define('VideoTag', {}, {
+ indexes: [
+ {
+ fields: [ 'videoId' ]
+ },
+ {
+ fields: [ 'tagId' ]
+ }
+ ]
+ })
return VideoTag
}