Skip to content

Commit

Permalink
modified delete all features from organism to allow incremental trans…
Browse files Browse the repository at this point in the history
…actions
  • Loading branch information
nathandunn committed Feb 3, 2017
1 parent c0d5b3b commit 817d795
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion grails-app/services/org/bbop/apollo/OrganismService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class OrganismService {
it[1]
}
println "uniqueNames ${uniqueNames.size()}"
Feature.withTransaction{
Feature.withNewTransaction{
def features = Feature.findAllByIdInList(ids)
features.each { f ->
f.delete()
Expand Down
2 changes: 2 additions & 0 deletions scripts/clean_organism.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/sh

if [ "$#" -ne 2 ]; then
echo "DO NOT USE ON PRODUCTION!!!"
echo "Use 'delete_annotations_from_organism.groovy' instead"
echo "Usage ./clean_organism.sh <common name> <database>"
exit ;
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package org.bbop.apollo

import grails.converters.JSON
import org.codehaus.groovy.grails.web.json.JSONObject
import spock.lang.Ignore

class OrganismServiceIntegrationSpec extends AbstractIntegrationSpec{

def organismService
def requestHandlingService


@Ignore
void "deleteAllFeaturesFromOrganism"() {

given: "a transcript with a UTR"
Expand All @@ -30,7 +32,6 @@ class OrganismServiceIntegrationSpec extends AbstractIntegrationSpec{
assert MRNA.count == 1
assert Gene.count == 1
assert FeatureEvent.count == 1
def allFeatures = Feature.all

// this is the new part
assert FeatureLocation.count == 8
Expand Down

0 comments on commit 817d795

Please sign in to comment.