18 lines
376 B
TypeScript
18 lines
376 B
TypeScript
import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
|
|
export default class extends BaseSchema {
|
|
protected tableName = 'files'
|
|
|
|
async up() {
|
|
this.schema.alterTable(this.tableName, (table) => {
|
|
table.string('file_key', 40).unique()
|
|
})
|
|
}
|
|
|
|
async down() {
|
|
this.schema.alterTable(this.tableName, (table) => {
|
|
table.dropColumn('file_key')
|
|
})
|
|
}
|
|
}
|