rename model code to fit convention
This commit is contained in:
parent
7468dca986
commit
ae8562c536
@ -1,6 +1,6 @@
|
||||
import defineRoleEmojiPair from './models/roleEmojiPair.js';
|
||||
import defineVoiceChannel from './models/voiceChannel.js';
|
||||
import defineMessage from './models/message.js';
|
||||
import defineRoleEmojiPair from './models/roleEmojiPairs.js';
|
||||
import defineVoiceChannel from './models/voiceChannels.js';
|
||||
import defineMessage from './models/messages.js';
|
||||
import { Sequelize } from 'sequelize';
|
||||
import { config } from 'dotenv';
|
||||
config();
|
||||
|
@ -1,15 +1,10 @@
|
||||
import { DataTypes } from "sequelize";
|
||||
|
||||
export default function(sequelize) {
|
||||
return sequelize.define('Message', {
|
||||
return sequelize.define('Messages', {
|
||||
id: {
|
||||
type: DataTypes.STRING,
|
||||
primaryKey: true,
|
||||
},
|
||||
roleEmojiPair: {
|
||||
deferrable: Deferrable.INITIALLY_IMMEDIATE,
|
||||
model: 'RoleEmojiPair',
|
||||
key: 'id',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
@ -1,12 +1,20 @@
|
||||
import { DataTypes } from "sequelize";
|
||||
import { DataTypes, Deferrable } from "sequelize";
|
||||
|
||||
export default function(sequelize) {
|
||||
return sequelize.define('RoleEmojiPair', {
|
||||
return sequelize.define('RoleEmojiPairs', {
|
||||
id: {
|
||||
defaultValue: DataTypes.UUIDV4,
|
||||
type: DataTypes.UUID,
|
||||
primaryKey: true,
|
||||
},
|
||||
message: {
|
||||
type: DataTypes.STRING,
|
||||
references: {
|
||||
deferrable: Deferrable.INITIALLY_IMMEDIATE,
|
||||
model: 'Messages',
|
||||
key: 'id',
|
||||
},
|
||||
},
|
||||
role: {
|
||||
type: DataTypes.STRING,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user