mirror of
https://github.com/mjrode/WhatToWatch.git
synced 2025-12-30 18:19:46 -06:00
Add index using migrations
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
return queryInterface.createTable('PlexLibraries', {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.createTable('PlexLibraries', {
|
||||
id: {
|
||||
allowNull: false,
|
||||
autoIncrement: true,
|
||||
@@ -50,6 +50,7 @@ module.exports = {
|
||||
type: Sequelize.DATE,
|
||||
},
|
||||
});
|
||||
return queryInterface.addIndex('PlexLibraries', ['UserId', 'title']);
|
||||
},
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
down: (queryInterface, Sequelize) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
return queryInterface.createTable('PlexSections', {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.createTable('PlexSections', {
|
||||
id: {
|
||||
allowNull: false,
|
||||
autoIncrement: true,
|
||||
@@ -32,6 +32,7 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
});
|
||||
return queryInterface.addIndex('PlexSections', ['UserId', 'title']);
|
||||
},
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
down: (queryInterface, Sequelize) => {
|
||||
|
||||
@@ -75,7 +75,7 @@ export default () => {
|
||||
|
||||
const port = server.get('port');
|
||||
|
||||
sequelize.sync().then(() => {
|
||||
sequelize.sync({force: true}).then(() => {
|
||||
server.listen(port, () => {
|
||||
console.log(`Express server listening on - http://${hostname}:${port}`);
|
||||
});
|
||||
|
||||
@@ -25,7 +25,7 @@ passport.use(
|
||||
async (accessToken, refreshToken, profile, done) => {
|
||||
console.log(profile);
|
||||
const existingUser = await models.User.findOne({
|
||||
where: {googleId: '103913097386807680151'},
|
||||
where: {googleId: profile.id},
|
||||
});
|
||||
|
||||
if (existingUser) {
|
||||
|
||||
Reference in New Issue
Block a user