database/seeders/1_MerchantSeeder.ts   A
last analyzed

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 23
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 18
mnd 0
bc 0
fnc 1
dl 0
loc 23
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
rs 10

1 Function

Rating   Name   Duplication   Size   Complexity  
A 1_MerchantSeeder.ts ➔ run 0 13 1
1
import BaseSeeder from '@ioc:Adonis/Lucid/Seeder'
2
import Merchant from 'App/Models/Merchant'
3
import moment from 'moment'
4
import crypto from 'crypto'
5
6
export default class extends BaseSeeder {
7
  public async run () {
8
    // Write your database queries inside the run method
9
    await Merchant.firstOrCreate(
10
    {
11
      email: '[email protected]'
12
    },
13
    {
14
      name: 'Test Merchant',
15
      email: '[email protected]',
16
      emailVerifiedAt: moment().format('YYYY-MM-DD HH:mm:ss'),
17
      password: '12345678',
18
      rememberMeToken: crypto.randomBytes(20).toString('hex'),
19
      isMerchant: true,
20
    })
21
  }
22
}
23