Skip to content

Commit 4d749fa

Browse files
committed
ts: all migrations
1 parent c4be2be commit 4d749fa

21 files changed

+53
-73
lines changed

lib/migrations/20150504155329-create-users.js renamed to lib/migrations/20150504155329-create-users.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
'use strict'
2-
module.exports = {
1+
export = {
32
up: function (queryInterface, Sequelize) {
43
return queryInterface.createTable('Users', {
54
id: {

lib/migrations/20150508114741-create-notes.js renamed to lib/migrations/20150508114741-create-notes.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
'use strict'
2-
module.exports = {
1+
export = {
32
up: function (queryInterface, Sequelize) {
43
return queryInterface.createTable('Notes', {
54
id: {

lib/migrations/20150515125813-create-temp.js renamed to lib/migrations/20150515125813-create-temp.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
'use strict'
2-
module.exports = {
1+
export = {
32
up: function (queryInterface, Sequelize) {
43
return queryInterface.createTable('Temp', {
54
id: {

lib/migrations/20150702001020-update-to-0_3_1.js renamed to lib/migrations/20150702001020-update-to-0_3_1.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
'use strict'
2-
module.exports = {
1+
export = {
32
up: function (queryInterface, Sequelize) {
43
return queryInterface.addColumn('Notes', 'shortid', {
54
type: Sequelize.STRING,

lib/migrations/20150915153700-change-notes-title-to-text.js renamed to lib/migrations/20150915153700-change-notes-title-to-text.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
'use strict'
2-
const isSQLite = require('../utils').isSQLite
3-
module.exports = {
1+
import {isSQLite} from "../utils";
2+
3+
export = {
44
up: function (queryInterface, Sequelize) {
55
return queryInterface.changeColumn('Notes', 'title', {
66
type: Sequelize.TEXT

lib/migrations/20160112220142-note-add-lastchange.js renamed to lib/migrations/20160112220142-note-add-lastchange.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
'use strict'
2-
module.exports = {
1+
export = {
32
up: function (queryInterface, Sequelize) {
43
return queryInterface.addColumn('Notes', 'lastchangeuserId', {
54
type: Sequelize.UUID

lib/migrations/20160420180355-note-add-alias.js renamed to lib/migrations/20160420180355-note-add-alias.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
'use strict'
2-
module.exports = {
1+
export = {
32
up: function (queryInterface, Sequelize) {
43
return queryInterface.addColumn('Notes', 'alias', {
54
type: Sequelize.STRING

lib/migrations/20160515114000-user-add-tokens.js renamed to lib/migrations/20160515114000-user-add-tokens.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
'use strict'
2-
module.exports = {
1+
export = {
32
up: function (queryInterface, Sequelize) {
43
return queryInterface.addColumn('Users', 'accessToken', Sequelize.STRING).then(function () {
54
return queryInterface.addColumn('Users', 'refreshToken', Sequelize.STRING)

lib/migrations/20160607060246-support-revision.js renamed to lib/migrations/20160607060246-support-revision.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
'use strict'
2-
module.exports = {
1+
export = {
32
up: function (queryInterface, Sequelize) {
43
return queryInterface.addColumn('Notes', 'savedAt', Sequelize.DATE).then(function () {
54
return queryInterface.createTable('Revisions', {
@@ -16,6 +15,7 @@ module.exports = {
1615
updatedAt: Sequelize.DATE
1716
})
1817
}).catch(function (error) {
18+
// @ts-ignore
1919
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') {
2020
console.log('Migration has already run… ignoring.')
2121
} else {

lib/migrations/20160703062241-support-authorship.js renamed to lib/migrations/20160703062241-support-authorship.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
'use strict'
2-
module.exports = {
1+
export = {
32
up: function (queryInterface, Sequelize) {
43
return queryInterface.addColumn('Notes', 'authorship', Sequelize.TEXT).then(function () {
54
return queryInterface.addColumn('Revisions', 'authorship', Sequelize.TEXT)

0 commit comments

Comments
 (0)