Files
yourpart3/backend/models/community/oauth_identity.js
Torsten Schulz (local) 1ab9407e79
All checks were successful
Deploy to production / deploy (push) Successful in 2m56s
Refactor code structure for improved readability and maintainability; optimize performance across multiple modules.
2026-07-21 09:08:15 +02:00

54 lines
1.1 KiB
JavaScript
Executable File

import { sequelize } from '../../utils/sequelize.js';
import { DataTypes } from 'sequelize';
const OAuthIdentity = sequelize.define('oauth_identity', {
userId: {
type: DataTypes.INTEGER,
allowNull: false,
field: 'user_id'
},
provider: {
type: DataTypes.STRING(64),
allowNull: false
},
issuer: {
type: DataTypes.TEXT,
allowNull: false
},
subject: {
type: DataTypes.TEXT,
allowNull: false
},
email: {
type: DataTypes.TEXT,
allowNull: true
},
createdAt: {
type: DataTypes.DATE,
allowNull: false,
field: 'created_at',
defaultValue: DataTypes.NOW
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false,
field: 'updated_at',
defaultValue: DataTypes.NOW
}
}, {
tableName: 'oauth_identity',
schema: 'community',
underscored: true,
timestamps: false,
indexes: [
{
unique: true,
fields: ['provider', 'subject']
},
{
fields: ['user_id']
}
]
});
export default OAuthIdentity;