Added more views and atlas APIs

This commit is contained in:
Jori Lallo
2016-05-07 11:52:08 -07:00
parent 84ba65f72a
commit cbe9c0b6ee
22 changed files with 397 additions and 27 deletions

View File

@ -4,9 +4,19 @@ import {
} from '../sequelize';
import Team from './Team';
const allowedAtlasTypes = [['atlas', 'journal']];
const Atlas = sequelize.define('atlas', {
id: { type: DataTypes.UUID, defaultValue: DataTypes.UUIDV4, primaryKey: true },
name: DataTypes.STRING,
description: DataTypes.STRING,
type: { type: DataTypes.STRING, validate: { isIn: allowedAtlasTypes }},
}, {
instanceMethods: {
getRecentDocuments() {
return [];
},
},
});
Atlas.belongsTo(Team);