forked from sagi/seepur
24 lines
421 B
JavaScript
24 lines
421 B
JavaScript
|
'use strict'
|
||
|
|
||
|
/** @type {import('@adonisjs/lucid/src/Schema')} */
|
||
|
const Schema = use('Schema')
|
||
|
|
||
|
class LinkSchema extends Schema {
|
||
|
up () {
|
||
|
this.create('link', (table) => {
|
||
|
table.increments()
|
||
|
table.bigInteger('user_id')
|
||
|
table.bigInteger('child_id')
|
||
|
table.timestamps()
|
||
|
|
||
|
table.index(['user_id', 'child_id'])
|
||
|
})
|
||
|
}
|
||
|
|
||
|
down () {
|
||
|
this.drop('link')
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = LinkSchema
|