prototypes: fix yamllint issues
[releng.git] / utils / test / vnfcatalogue / helpers / schema.js
1 /*******************************************************************************
2  * Copyright (c) 2017 Kumar Rishabh(penguinRaider) and others.
3  *
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Apache License, Version 2.0
6  * which accompanies this distribution, and is available at
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *******************************************************************************/
9 var Schema = {
10     photo: {
11         photo_id: {type: 'increments', nullable: false, primary: true},
12         photo_url: {type: 'string', maxlength: 254, nullable: false}
13     },
14     user: {
15         user_id: {type: 'increments', nullable: false, primary: true},
16         user_name: {type: 'string', maxlength: 254, nullable: false},
17         password: {type: 'string', maxlength: 150, nullable: false},
18         email_id: {type: 'string', maxlength: 254, nullable: false, unique: true, validations: {isEmail: true}},
19         photo_id: {type: 'integer', nullable: true, unsigned: true, references: 'photo.photo_id'},
20         company: {type: 'string', maxlength: 254, nullable: false},
21         introduction: {type: 'string', maxlength: 510, nullable: false},
22         last_login: {type: 'dateTime', nullable: true},
23         created_at: {type: 'dateTime', nullable: false},
24     },
25     vnf: {
26         vnf_id: {type: 'increments', nullable: false, primary: true},
27         vnf_name: {type: 'string', maxlength: 254, nullable: false},
28         repo_url: {type: 'string', maxlength: 254, nullable: false},
29         photo_id: {type: 'integer', nullable: true, unsigned: true, references: 'photo.photo_id'},
30         submitter_id: {type: 'integer', nullable: false, unsigned: true, references: 'user.user_id'},
31         lines_of_code: {type: 'integer', nullable: true, unsigned: true},
32         versions: {type: 'integer', nullable: true, unsigned: true},
33         no_of_developers: {type: 'integer', nullable: true, unsigned: true},
34     },
35     tag: {
36         tag_id: {type: 'increments', nullable: false, primary: true},
37         name: {type: 'string', maxlength: 150, nullable: false}
38     },
39     vnf_tags: {
40         vnf_tag_id: {type: 'increments', nullable: false, primary: true},
41         tag_id: {type: 'integer', nullable: false, unsigned: true, references: 'tag.tag_id'},
42         vnf_id: {type: 'integer', nullable: false, unsigned: true, references: 'vnf.vnf_id'},
43     },
44     vnf_contributors: {
45         vnf_contributors_id: {type: 'increments', nullable: false, primary: true},
46         user_id: {type: 'integer', nullable: false, unsigned: true, references: 'user.user_id'},
47         vnf_id: {type: 'integer', nullable: false, unsigned: true, references: 'vnf.vnf_id'},
48         created_at: {type: 'dateTime', nullable: false},
49     }
50 };
51 module.exports = Schema;