Skip to content

Commit

Permalink
Merge pull request #129 from harena-lab/development
Browse files Browse the repository at this point in the history
refactor (cases/database): changing char set to utf8m4
  • Loading branch information
santanche authored Jan 20, 2022
2 parents 8705f38 + 2b6b31e commit 7705fed
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict'

/** @type {import('@adonisjs/lucid/src/Schema')} */
const Schema = use('Schema')

class CasesUpdateCharacterSetSchema extends Schema {
up () {
this.table('cases', (table) => {
table.string('title').notNullable().collate('utf8mb4_unicode_ci').alter()
table.string('description').collate('utf8mb4_unicode_ci').alter()
table.string('domain', 50).collate('utf8mb4_unicode_ci').alter()
table.string('specialty', 50).collate('utf8mb4_unicode_ci').alter()
table.string('keywords', 512).collate('utf8mb4_unicode_ci').alter()
table.text('source').collate('utf8mb4_unicode_ci')
})
}

down () {
this.table('cases', (table) => {
table.string('title').notNullable().alter()
table.string('description').alter()
table.string('domain', 50).alter()
table.string('specialty', 50).alter()
table.string('keywords', 512).alter()
table.dropColumn('source')
})
}
}

module.exports = CasesUpdateCharacterSetSchema
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict'

/** @type {import('@adonisjs/lucid/src/Schema')} */
const Schema = use('Schema')

class CaseVersionsUpdateCharacterSetSchema extends Schema {
up () {
this.table('case_versions', (table) => {
table.text('source').collate('utf8mb4_unicode_ci').alter()
})
}

down () {
this.table('case_versions', (table) => {
table.text('source').alter()
})
}
}

module.exports = CaseVersionsUpdateCharacterSetSchema

0 comments on commit 7705fed

Please sign in to comment.