Skip to content

Commit

Permalink
#411 - remove wrong constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
cbellone committed Apr 9, 2018
1 parent 37bca63 commit 54d4844
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,10 @@ public ResourceController(UploadedResourceManager uploadedResourceManager,
@ExceptionHandler(Exception.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
public String handleSyntaxError(Exception ex) {
Optional<String> cause = Optional.ofNullable(ex.getCause()).filter(MustacheException.class::isInstance).map(Throwable::getMessage);
if(cause.isPresent()) {
return cause.get();
}
return "Something went wrong. Please check the syntax and retry";
Optional<String> cause = Optional.ofNullable(ex.getCause())
.filter(MustacheException.class::isInstance)
.map(Throwable::getMessage);
return cause.orElse("Something went wrong. Please check the syntax and retry");
}

@RequestMapping(value = "/overridable-template/", method = RequestMethod.GET)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
@QueryRepository
public interface UploadedResourceRepository {

String hasResouceGlobal = "select exists(select name from resource_global where name = :name) as res";
@Query(hasResouceGlobal)
String hasResourceGlobal = "select exists(select name from resource_global where name = :name) as res";
@Query(hasResourceGlobal)
@QueriesOverride({
@QueryOverride(value = hasResouceGlobal + " from (values(0))", db = "HSQLDB")
@QueryOverride(value = hasResourceGlobal + " from (values(0))", db = "HSQLDB")
})
boolean hasResource(@Bind("name") String name);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--
-- This file is part of alf.io.
--
-- alf.io is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- alf.io is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with alf.io. If not, see <http://www.gnu.org/licenses/>.
--

ALTER TABLE resource_event DROP CONSTRAINT resource_event_pkey;

0 comments on commit 54d4844

Please sign in to comment.