generated from HackYourFuture-CPH/boilerplate-for-fp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed migration questions.js seed file
- Loading branch information
Aaron Moses
committed
May 1, 2024
1 parent
2e1e363
commit 950c7bc
Showing
1 changed file
with
11 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
// questions.js | ||
exports.seed = function (knex) { | ||
// Deletes all existing entries | ||
return knex('Questions') | ||
.del() | ||
.then(() => { | ||
// Inserts seed entries | ||
return knex('Questions').insert([ | ||
{ id: 1, title: 'What did we do well?' }, | ||
{ id: 2, title: 'What did we learn?' }, | ||
{ id: 3, title: 'What should we do differently next time?' }, | ||
{ id: 4, title: 'What are the roadblocks?' }, | ||
]); | ||
}); | ||
return knex('Questions').insert([ | ||
{ id: 1, title: 'What did we do well?' }, | ||
{ id: 2, title: 'What did we learn?' }, | ||
{ id: 3, title: 'What should we do differently next time?' }, | ||
{ id: 4, title: 'What are the roadblocks?' }, | ||
]); | ||
}; |