Author: obruce Date: 2014-05-07 11:53:17 +0200 (Wed, 07 May 2014) New Revision: 2965 Url: http://forge.chorem.org/projects/jtimer/repository/revisions/2965 Log: Correction base ajout delete cascade Modified: branches/ng-jtimer/src/main/java/org/chorem/jtimer/storage/Storage.java branches/ng-jtimer/src/main/webapp/js/service.js Modified: branches/ng-jtimer/src/main/java/org/chorem/jtimer/storage/Storage.java =================================================================== --- branches/ng-jtimer/src/main/java/org/chorem/jtimer/storage/Storage.java 2014-05-06 15:21:10 UTC (rev 2964) +++ branches/ng-jtimer/src/main/java/org/chorem/jtimer/storage/Storage.java 2014-05-07 09:53:17 UTC (rev 2965) @@ -144,7 +144,7 @@ statement.executeUpdate("CREATE TABLE " + TABLE_VERSION + "(version VARCHAR(10))"); statement.executeUpdate("CREATE TABLE " + TABLE_TASK + - "(id LONG NOT NULL UNIQUE AUTO_INCREMENT," + + "(id LONG NOT NULL AUTO_INCREMENT," + " taskId VARCHAR(255) NOT NULL UNIQUE," + " name VARCHAR(255) NOT NULL," + " parent VARCHAR(255)," + @@ -156,7 +156,11 @@ " date DATE," + " uuid varchar(255) unique," + " duration LONG," + - " PRIMARY KEY (taskid, date, uuid))"); + " PRIMARY KEY (taskid, date, uuid)" + + ", FOREIGN KEY (taskid)" + + " REFERENCES " + TABLE_TASK +"(id)" + + " ON DELETE CASCADE" + + ")"); } catch (SQLException ex) { throw new StorageException("Can't create schema", ex); } finally { Modified: branches/ng-jtimer/src/main/webapp/js/service.js =================================================================== --- branches/ng-jtimer/src/main/webapp/js/service.js 2014-05-06 15:21:10 UTC (rev 2964) +++ branches/ng-jtimer/src/main/webapp/js/service.js 2014-05-07 09:53:17 UTC (rev 2965) @@ -20,10 +20,9 @@ // Encapsule l'acces au server return $resource("rest/tasks/:taskId/time",{}, { - query : {method:'GET', isArray:true}, + query : {method:'GET', isArray:true}, get : {method: 'GET', isArray: false}, update: {method: "PUT"}, - delete: { method: 'DELETE' }, create: { method: 'POST' }