summaryrefslogtreecommitdiff
path: root/lib/migrations
diff options
context:
space:
mode:
authorSheogorath2019-05-31 00:27:56 +0200
committerSheogorath2019-05-31 00:30:29 +0200
commit4da68597f701376307fe8849ed57edd3a80833ed (patch)
treefb50db25c63b3b2cb70426ba3eab42007be60134 /lib/migrations
parent3eca0a74ae3d87a42acb7c7b8e39e2c389e3c96c (diff)
Fix eslint warnings
Since we are about to release it's time to finally fix our linting. This patch basically runs eslint --fix and does some further manual fixes. Also it sets up eslint to fail on every warning on order to make warnings visable in the CI process. There should no functional change be introduced. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
Diffstat (limited to 'lib/migrations')
-rw-r--r--lib/migrations/20150702001020-update-to-0_3_1.js1
-rw-r--r--lib/migrations/20160112220142-note-add-lastchange.js7
-rw-r--r--lib/migrations/20160420180355-note-add-alias.js1
-rw-r--r--lib/migrations/20160515114000-user-add-tokens.js1
-rw-r--r--lib/migrations/20160607060246-support-revision.js1
-rw-r--r--lib/migrations/20160703062241-support-authorship.js1
-rw-r--r--lib/migrations/20161009040430-support-delete-note.js1
-rw-r--r--lib/migrations/20161201050312-support-email-signin.js2
-rw-r--r--lib/migrations/20171009121200-longtext-for-mysql.js16
-rw-r--r--lib/migrations/20180209120907-longtext-of-authorship.js8
-rw-r--r--lib/migrations/20180306150303-fix-enum.js4
11 files changed, 26 insertions, 17 deletions
diff --git a/lib/migrations/20150702001020-update-to-0_3_1.js b/lib/migrations/20150702001020-update-to-0_3_1.js
index e1a88661..b941048e 100644
--- a/lib/migrations/20150702001020-update-to-0_3_1.js
+++ b/lib/migrations/20150702001020-update-to-0_3_1.js
@@ -22,6 +22,7 @@ module.exports = {
})
}).catch(function (error) {
if (error.message === 'SQLITE_ERROR: duplicate column name: shortid' || error.message === "ER_DUP_FIELDNAME: Duplicate column name 'shortid'" || error.message === 'column "shortid" of relation "Notes" already exists') {
+ // eslint-disable-next-line no-console
console.log('Migration has already run… ignoring.')
} else {
throw error
diff --git a/lib/migrations/20160112220142-note-add-lastchange.js b/lib/migrations/20160112220142-note-add-lastchange.js
index 87e3ff19..69781cef 100644
--- a/lib/migrations/20160112220142-note-add-lastchange.js
+++ b/lib/migrations/20160112220142-note-add-lastchange.js
@@ -9,6 +9,7 @@ module.exports = {
})
}).catch(function (error) {
if (error.message === 'SQLITE_ERROR: duplicate column name: lastchangeuserId' || error.message === "ER_DUP_FIELDNAME: Duplicate column name 'lastchangeuserId'" || error.message === 'column "lastchangeuserId" of relation "Notes" already exists') {
+ // eslint-disable-next-line no-console
console.log('Migration has already run… ignoring.')
} else {
throw error
@@ -18,8 +19,8 @@ module.exports = {
down: function (queryInterface, Sequelize) {
return queryInterface.removeColumn('Notes', 'lastchangeAt')
- .then(function () {
- return queryInterface.removeColumn('Notes', 'lastchangeuserId')
- })
+ .then(function () {
+ return queryInterface.removeColumn('Notes', 'lastchangeuserId')
+ })
}
}
diff --git a/lib/migrations/20160420180355-note-add-alias.js b/lib/migrations/20160420180355-note-add-alias.js
index 45d53e69..82941a91 100644
--- a/lib/migrations/20160420180355-note-add-alias.js
+++ b/lib/migrations/20160420180355-note-add-alias.js
@@ -9,6 +9,7 @@ module.exports = {
})
}).catch(function (error) {
if (error.message === 'SQLITE_ERROR: duplicate column name: alias' || error.message === "ER_DUP_FIELDNAME: Duplicate column name 'alias'" || error.message === 'column "alias" of relation "Notes" already exists') {
+ // eslint-disable-next-line no-console
console.log('Migration has already run… ignoring.')
} else {
throw error
diff --git a/lib/migrations/20160515114000-user-add-tokens.js b/lib/migrations/20160515114000-user-add-tokens.js
index 435ae9cb..e47ef5a4 100644
--- a/lib/migrations/20160515114000-user-add-tokens.js
+++ b/lib/migrations/20160515114000-user-add-tokens.js
@@ -5,6 +5,7 @@ module.exports = {
return queryInterface.addColumn('Users', 'refreshToken', Sequelize.STRING)
}).catch(function (error) {
if (error.message === 'SQLITE_ERROR: duplicate column name: accessToken' || error.message === "ER_DUP_FIELDNAME: Duplicate column name 'accessToken'" || error.message === 'column "accessToken" of relation "Users" already exists') {
+ // eslint-disable-next-line no-console
console.log('Migration has already run… ignoring.')
} else {
throw error
diff --git a/lib/migrations/20160607060246-support-revision.js b/lib/migrations/20160607060246-support-revision.js
index 547f89b8..b318ea44 100644
--- a/lib/migrations/20160607060246-support-revision.js
+++ b/lib/migrations/20160607060246-support-revision.js
@@ -17,6 +17,7 @@ module.exports = {
})
}).catch(function (error) {
if (error.message === 'SQLITE_ERROR: duplicate column name: savedAt' | error.message === "ER_DUP_FIELDNAME: Duplicate column name 'savedAt'" || error.message === 'column "savedAt" of relation "Notes" already exists') {
+ // eslint-disable-next-line no-console
console.log('Migration has already run… ignoring.')
} else {
throw error
diff --git a/lib/migrations/20160703062241-support-authorship.js b/lib/migrations/20160703062241-support-authorship.js
index f452b1a7..86054f1c 100644
--- a/lib/migrations/20160703062241-support-authorship.js
+++ b/lib/migrations/20160703062241-support-authorship.js
@@ -18,6 +18,7 @@ module.exports = {
})
}).catch(function (error) {
if (error.message === 'SQLITE_ERROR: duplicate column name: authorship' || error.message === "ER_DUP_FIELDNAME: Duplicate column name 'authorship'" || error.message === 'column "authorship" of relation "Notes" already exists') {
+ // eslint-disable-next-line no-console
console.log('Migration has already run… ignoring.')
} else {
throw error
diff --git a/lib/migrations/20161009040430-support-delete-note.js b/lib/migrations/20161009040430-support-delete-note.js
index 56a336ac..b7ee72c3 100644
--- a/lib/migrations/20161009040430-support-delete-note.js
+++ b/lib/migrations/20161009040430-support-delete-note.js
@@ -3,6 +3,7 @@ module.exports = {
up: function (queryInterface, Sequelize) {
return queryInterface.addColumn('Notes', 'deletedAt', Sequelize.DATE).catch(function (error) {
if (error.message === 'SQLITE_ERROR: duplicate column name: deletedAt' || error.message === "ER_DUP_FIELDNAME: Duplicate column name 'deletedAt'" || error.message === 'column "deletedAt" of relation "Notes" already exists') {
+ // eslint-disable-next-line no-console
console.log('Migration has already run… ignoring.')
} else {
throw error
diff --git a/lib/migrations/20161201050312-support-email-signin.js b/lib/migrations/20161201050312-support-email-signin.js
index 26bc09ea..5c9fbf85 100644
--- a/lib/migrations/20161201050312-support-email-signin.js
+++ b/lib/migrations/20161201050312-support-email-signin.js
@@ -4,6 +4,7 @@ module.exports = {
return queryInterface.addColumn('Users', 'email', Sequelize.TEXT).then(function () {
return queryInterface.addColumn('Users', 'password', Sequelize.TEXT).catch(function (error) {
if (error.message === "ER_DUP_FIELDNAME: Duplicate column name 'password'" || error.message === 'column "password" of relation "Users" already exists') {
+ // eslint-disable-next-line no-console
console.log('Migration has already run… ignoring.')
} else {
throw error
@@ -11,6 +12,7 @@ module.exports = {
})
}).catch(function (error) {
if (error.message === 'SQLITE_ERROR: duplicate column name: email' || error.message === "ER_DUP_FIELDNAME: Duplicate column name 'email'" || error.message === 'column "email" of relation "Users" already exists') {
+ // eslint-disable-next-line no-console
console.log('Migration has already run… ignoring.')
} else {
throw error
diff --git a/lib/migrations/20171009121200-longtext-for-mysql.js b/lib/migrations/20171009121200-longtext-for-mysql.js
index 2a7d0d3a..cb9fc8a5 100644
--- a/lib/migrations/20171009121200-longtext-for-mysql.js
+++ b/lib/migrations/20171009121200-longtext-for-mysql.js
@@ -1,16 +1,16 @@
'use strict'
module.exports = {
up: function (queryInterface, Sequelize) {
- queryInterface.changeColumn('Notes', 'content', {type: Sequelize.TEXT('long')})
- queryInterface.changeColumn('Revisions', 'patch', {type: Sequelize.TEXT('long')})
- queryInterface.changeColumn('Revisions', 'content', {type: Sequelize.TEXT('long')})
- queryInterface.changeColumn('Revisions', 'lastContent', {type: Sequelize.TEXT('long')})
+ queryInterface.changeColumn('Notes', 'content', { type: Sequelize.TEXT('long') })
+ queryInterface.changeColumn('Revisions', 'patch', { type: Sequelize.TEXT('long') })
+ queryInterface.changeColumn('Revisions', 'content', { type: Sequelize.TEXT('long') })
+ queryInterface.changeColumn('Revisions', 'lastContent', { type: Sequelize.TEXT('long') })
},
down: function (queryInterface, Sequelize) {
- queryInterface.changeColumn('Notes', 'content', {type: Sequelize.TEXT})
- queryInterface.changeColumn('Revisions', 'patch', {type: Sequelize.TEXT})
- queryInterface.changeColumn('Revisions', 'content', {type: Sequelize.TEXT})
- queryInterface.changeColumn('Revisions', 'lastContent', {type: Sequelize.TEXT})
+ queryInterface.changeColumn('Notes', 'content', { type: Sequelize.TEXT })
+ queryInterface.changeColumn('Revisions', 'patch', { type: Sequelize.TEXT })
+ queryInterface.changeColumn('Revisions', 'content', { type: Sequelize.TEXT })
+ queryInterface.changeColumn('Revisions', 'lastContent', { type: Sequelize.TEXT })
}
}
diff --git a/lib/migrations/20180209120907-longtext-of-authorship.js b/lib/migrations/20180209120907-longtext-of-authorship.js
index 4cca5444..c5d8a1ef 100644
--- a/lib/migrations/20180209120907-longtext-of-authorship.js
+++ b/lib/migrations/20180209120907-longtext-of-authorship.js
@@ -2,12 +2,12 @@
module.exports = {
up: function (queryInterface, Sequelize) {
- queryInterface.changeColumn('Notes', 'authorship', {type: Sequelize.TEXT('long')})
- queryInterface.changeColumn('Revisions', 'authorship', {type: Sequelize.TEXT('long')})
+ queryInterface.changeColumn('Notes', 'authorship', { type: Sequelize.TEXT('long') })
+ queryInterface.changeColumn('Revisions', 'authorship', { type: Sequelize.TEXT('long') })
},
down: function (queryInterface, Sequelize) {
- queryInterface.changeColumn('Notes', 'authorship', {type: Sequelize.TEXT})
- queryInterface.changeColumn('Revisions', 'authorship', {type: Sequelize.TEXT})
+ queryInterface.changeColumn('Notes', 'authorship', { type: Sequelize.TEXT })
+ queryInterface.changeColumn('Revisions', 'authorship', { type: Sequelize.TEXT })
}
}
diff --git a/lib/migrations/20180306150303-fix-enum.js b/lib/migrations/20180306150303-fix-enum.js
index 0ee58a94..433a9749 100644
--- a/lib/migrations/20180306150303-fix-enum.js
+++ b/lib/migrations/20180306150303-fix-enum.js
@@ -2,10 +2,10 @@
module.exports = {
up: function (queryInterface, Sequelize) {
- queryInterface.changeColumn('Notes', 'permission', {type: Sequelize.ENUM('freely', 'editable', 'limited', 'locked', 'protected', 'private')})
+ queryInterface.changeColumn('Notes', 'permission', { type: Sequelize.ENUM('freely', 'editable', 'limited', 'locked', 'protected', 'private') })
},
down: function (queryInterface, Sequelize) {
- queryInterface.changeColumn('Notes', 'permission', {type: Sequelize.ENUM('freely', 'editable', 'locked', 'private')})
+ queryInterface.changeColumn('Notes', 'permission', { type: Sequelize.ENUM('freely', 'editable', 'locked', 'private') })
}
}