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 defineRoleEmojiPair from './models/roleEmojiPairs.js';
|
||||||
import defineVoiceChannel from './models/voiceChannel.js';
|
import defineVoiceChannel from './models/voiceChannels.js';
|
||||||
import defineMessage from './models/message.js';
|
import defineMessage from './models/messages.js';
|
||||||
import { Sequelize } from 'sequelize';
|
import { Sequelize } from 'sequelize';
|
||||||
import { config } from 'dotenv';
|
import { config } from 'dotenv';
|
||||||
config();
|
config();
|
||||||
|
@ -1,15 +1,10 @@
|
|||||||
import { DataTypes } from "sequelize";
|
import { DataTypes } from "sequelize";
|
||||||
|
|
||||||
export default function(sequelize) {
|
export default function(sequelize) {
|
||||||
return sequelize.define('Message', {
|
return sequelize.define('Messages', {
|
||||||
id: {
|
id: {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
primaryKey: true,
|
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) {
|
export default function(sequelize) {
|
||||||
return sequelize.define('RoleEmojiPair', {
|
return sequelize.define('RoleEmojiPairs', {
|
||||||
id: {
|
id: {
|
||||||
defaultValue: DataTypes.UUIDV4,
|
defaultValue: DataTypes.UUIDV4,
|
||||||
type: DataTypes.UUID,
|
type: DataTypes.UUID,
|
||||||
primaryKey: true,
|
primaryKey: true,
|
||||||
},
|
},
|
||||||
|
message: {
|
||||||
|
type: DataTypes.STRING,
|
||||||
|
references: {
|
||||||
|
deferrable: Deferrable.INITIALLY_IMMEDIATE,
|
||||||
|
model: 'Messages',
|
||||||
|
key: 'id',
|
||||||
|
},
|
||||||
|
},
|
||||||
role: {
|
role: {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user