Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added step for deleting session records

  • Loading branch information...
commit 5924a7e20787408676fe1919137b8bbe88671a42 1 parent bd626f1
@benjreinhart benjreinhart authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 core/db/seeds.coffee
View
14 core/db/seeds.coffee
@@ -2,8 +2,9 @@ async = require 'async'
{ APP_ROOT } = process.env
-User = require "#{ APP_ROOT }/components/users/datastore"
-Promise = require "#{ APP_ROOT }/components/promises/datastore"
+User = require "#{ APP_ROOT }/components/users/datastore"
+Promise = require "#{ APP_ROOT }/components/promises/datastore"
+OAuthSession = require "#{ APP_ROOT }/components/promises/datastore"
console.log 'Seeding database...'
@@ -19,11 +20,18 @@ deletePromises = (cb) ->
console.log "Removed #{count} records from Promise table"
cb null
+deleteSessions = (cb) ->
+ OAuthSession.find().remove (err, count) ->
+ cb err if err?
+ console.log "Removed #{count} records from OAuthSession table"
+ cb null
+
async.parallel [
deleteUsers
deletePromises
+ deleteSessions
], (err) ->
throw err if err?
- console.log "Removed Users and Promises"
+ console.log "Cleared DB"
process.exit 0
Please sign in to comment.
Something went wrong with that request. Please try again.