Skip to content

mghahari/sequelize-smart-seed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Smart Seed

Usage

smartSeed(<Model>, <records>, ?['key1, key2', ...])

default value for keys is id

in seed up function:

- const smartSeed = require('sequelize-smart-seed)
- const Models = require('./models')

up: async function () {
  await smartSeed(Models.MyModel, [
    id: 1,
    name: "test",
    ...
  ],
  ...
  ,['id'])
}

About

Run seed:all without duplicates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published