aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/request/request-to-pod.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/request/request-to-pod.ts')
-rw-r--r--server/models/request/request-to-pod.ts51
1 files changed, 0 insertions, 51 deletions
diff --git a/server/models/request/request-to-pod.ts b/server/models/request/request-to-pod.ts
deleted file mode 100644
index 4e14e918b..000000000
--- a/server/models/request/request-to-pod.ts
+++ /dev/null
@@ -1,51 +0,0 @@
1import * as Sequelize from 'sequelize'
2
3import { addMethodsToModel } from '../utils'
4import {
5 RequestToPodInstance,
6 RequestToPodAttributes,
7
8 RequestToPodMethods
9} from './request-to-pod-interface'
10
11let RequestToPod: Sequelize.Model<RequestToPodInstance, RequestToPodAttributes>
12let removeByRequestIdsAndPod: RequestToPodMethods.RemoveByRequestIdsAndPod
13
14export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
15 RequestToPod = sequelize.define<RequestToPodInstance, RequestToPodAttributes>('RequestToPod', {}, {
16 indexes: [
17 {
18 fields: [ 'requestId' ]
19 },
20 {
21 fields: [ 'podId' ]
22 },
23 {
24 fields: [ 'requestId', 'podId' ],
25 unique: true
26 }
27 ]
28 })
29
30 const classMethods = [
31 removeByRequestIdsAndPod
32 ]
33 addMethodsToModel(RequestToPod, classMethods)
34
35 return RequestToPod
36}
37
38// ---------------------------------------------------------------------------
39
40removeByRequestIdsAndPod = function (requestsIds: number[], podId: number) {
41 const query = {
42 where: {
43 requestId: {
44 [Sequelize.Op.in]: requestsIds
45 },
46 podId: podId
47 }
48 }
49
50 return RequestToPod.destroy(query)
51}