Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

add documentation for priority #23

Open
frostme opened this issue Sep 15, 2016 · 3 comments
Open

add documentation for priority #23

frostme opened this issue Sep 15, 2016 · 3 comments

Comments

@frostme
Copy link
Owner

frostme commented Sep 15, 2016

add readme documentation for priority

@antonus
Copy link

antonus commented Jun 26, 2017

found this by digging through the source. useful! would be great to document :)

@MattGarnettWelsh
Copy link

Hi guys,

Currently struggling with this. How did you set the priority of your seed files? I have multiple seeds in /config/seeds/ and one config/seeds.js file that requires them all.

Order for me is currently a big problem. Waterline is trying to form relationships between seeds that aren't yet instantiated.

@antonus
Copy link

antonus commented Aug 3, 2017

I'm using the priority attribute on models in seeds. So like:

module.exports.seeds = {
  model1: {
    data: [
      {
        id: 1,
        field: "text1",
      },
      {
        id: 2,
        field: "text2",
      }
    ],
    unique: ["field"],
    priority: 1
  },
 model2: {
    data: [
      {
        id: 1,
        field: "text1",
      },
      {
        id: 2,
        field: "text2",
      }
    ],
    unique: ["field"],
    priority: 2
  }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants