Skip to content

Commit

Permalink
refactor (cases/database): changing char set to utf8m4
Browse files Browse the repository at this point in the history
  • Loading branch information
santanche committed Jan 19, 2022
1 parent d1d5fd3 commit 2b6b31e
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 2b6b31e

Please sign in to comment.