Created
February 17, 2020 13:28
-
-
Save pratikagashe/1d8e4b35d3715cca8e27683522cde093 to your computer and use it in GitHub Desktop.
Seed file to insert data into posts postgraphile demo
This file contains hidden or 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('posts') | |
| .del() | |
| .then(function() { | |
| // Inserts seed entries | |
| return knex('posts').insert([ | |
| { | |
| id: 1, | |
| title: 'Sample blog', | |
| body: | |
| 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec elementum mi purus, dignissim faucibus lectus pulvinar vitae.', | |
| user_id: 1, | |
| }, | |
| ]) | |
| }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment