Created
October 12, 2020 03:38
-
-
Save Wonder2210/83eeff9e203aec814cfb1533eb0f0637 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.seed = function (knex) { | |
// Deletes ALL existing entries | |
return knex("table name") | |
.del() | |
.then(function () { | |
// Inserts seed entries | |
return knex("table name").insert([ | |
// here will be your data with the fields your database needs | |
// for example { id: 1, full_name: "luis", country_code: 58 }, | |
, | |
]); | |
}) | |
.then(() => { | |
return knex("table name") | |
.del() | |
.then(function () { | |
// Inserts seed entries | |
return knex("table name").insert([ | |
// here will be your data with the fields your database needs | |
// for example { id: 1, full_name: "luis", country_code: 58 }, | |
, | |
]); | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment