APCOvernight/adonis-schema-builder

View on GitHub
src/Generators/templates/factory.mustache

Summary

Maintainability
Test Coverage
'use strict'

/*
|--------------------------------------------------------------------------
| Factory
|--------------------------------------------------------------------------
|
| Factories are used to define blueprints for database tables or Lucid
| models. Later you can use these blueprints to seed your database
| with dummy data.
|
*/

const Factory = use('Factory')
{{ #tables }}

Factory.blueprint('App/Models/{{ name }}', (faker) => {
  return {
  {{ #columnsArray }}
  {{ #fieldRule }}
    {{ &fieldRule }}
  {{ /fieldRule}}
  {{ /columnsArray }}
  }
})
{{ /tables }}