remade DB structure

This commit is contained in:
Phil 2020-05-08 03:16:10 +02:00
commit f449eb1892
4 changed files with 24 additions and 2 deletions

View file

@ -7,7 +7,7 @@ module.exports = sequelize.define('hubName', {
autoIncrement: true,
},
hubName: {
type: Sequelize.STRING(30),
type: Sequelize.STRING(50),
allowNull: false,
unique: true,
},

View file

@ -9,4 +9,15 @@ module.exports = sequelize.define('messageLink', {
type: Sequelize.STRING(30),
primaryKey: true,
},
channelID: {
type: Sequelize.STRING(30),
allowNull: false,
},
},
{
uniqueKeys: {
messageUnique: {
fields: ['messageID', 'channelID'],
},
},
});

View file

@ -6,7 +6,7 @@ module.exports = {
autoIncrement: true,
},
hubName: {
type: Sequelize.STRING(30),
type: Sequelize.STRING(50),
allowNull: false,
unique: true,
},

View file

@ -8,8 +8,19 @@ module.exports = {
type: Sequelize.STRING(30),
primaryKey: true,
},
channelID: {
type: Sequelize.STRING(30),
allowNull: false,
},
createdAt: Sequelize.DATE,
updatedAt: Sequelize.DATE,
},
{
uniqueKeys: {
messageUnique: {
fields: ['messageID', 'channelID'],
},
},
}),
down: (queryInterface, Sequelize) => queryInterface.dropTable('messagelinks'),
};