File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
const resetDatabase = async ( knex ) => {
2
+ await knex . raw ( 'TRUNCATE TABLE github_repositories RESTART IDENTITY CASCADE' )
2
3
await knex . raw ( 'TRUNCATE TABLE github_organizations RESTART IDENTITY CASCADE' )
3
4
await knex . raw ( 'TRUNCATE TABLE projects RESTART IDENTITY CASCADE' )
4
5
}
@@ -16,10 +17,18 @@ const addGithubOrg = async (knex, data) => {
16
17
return githubOrg
17
18
}
18
19
20
+ const getAllGithubRepos = ( knex ) => knex ( 'github_repositories' ) . select ( '*' )
21
+ const addGithubRepo = async ( knex , data ) => {
22
+ const [ githubRepo ] = await knex ( 'github_repositories' ) . insert ( data ) . returning ( '*' )
23
+ return githubRepo
24
+ }
25
+
19
26
module . exports = {
20
27
resetDatabase,
21
28
getAllProjects,
22
29
getAllGithubOrgs,
23
30
addProject,
24
- addGithubOrg
31
+ addGithubOrg,
32
+ getAllGithubRepos,
33
+ addGithubRepo
25
34
}
You can’t perform that action at this time.
0 commit comments