/
schema.js
32 lines (25 loc) · 1000 Bytes
/
schema.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
db/schema.js contains database schema description for application models
by default (when using jugglingdb as ORM) this file uses database connection
described in config/database.json. But it's possible to use another database
connections and multiple different schemas, docs available at
http://railwayjs.com/orm.html
Example of model definition:
define('User', function () {
property('email', String, { index: true });
property('password', String);
property('activated', Boolean, {default: false});
});
Example of schema configured without config/database.json (heroku redistogo addon):
schema('redis', {url: process.env.REDISTOGO_URL}, function () {
// model definitions here
});
*/
var Message = describe('Message', function () {
property('firstname', String);
property('lastname', String);
property('phone', String);
property('message', String);
property('type', String, {default: 'voice'}); // sms, voice
property('status');
});