1703483910219_users.ts 406 B

12345678910111213
  1. import BaseSchema from '@ioc:Adonis/Lucid/Schema'
  2. export default class extends BaseSchema {
  3. protected tableName = 'users'
  4. public async up() {
  5. this.schema.alterTable(this.tableName, (table) => {
  6. table.dropForeign('invitor')
  7. table.dropColumn('invitor')
  8. table.integer('referrer').unsigned().nullable().references('id').inTable('users')
  9. })
  10. }
  11. }