Created
March 12, 2014 17:30
-
-
Save bitdewy/9511929 to your computer and use it in GitHub Desktop.
xocean schema
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// !!! sketch, no constraint | |
var mongoose = require('mongoose'), | |
Schema = mongoose.Schema; | |
var WorkItemSchema = new Schema({ | |
description: String, | |
createdAt: Date, | |
lastModified: Date, | |
status: Number | |
}); | |
// no comment on comment so far | |
var CommentSchema = new Schema({ | |
username: String, | |
content: String | |
}); | |
var TagSchema = new Schema({ | |
name: String, | |
description: String | |
}) | |
var ArticleSchema = new Schema({ | |
title: String, | |
body: String, | |
createdAt: Date, | |
lastModified: Date, | |
comments: [CommentSchema], | |
tags: [TagSchema], | |
status: Number | |
}); | |
var UserSchema = new Schema({ | |
name: String, | |
email: String, | |
role: { | |
type: String, | |
default: 'user' | |
}, | |
hashedPassword: String, | |
provider: String, | |
salt: String, | |
facebook: {}, | |
twitter: {}, | |
github: {}, | |
google: {}, | |
group: Number, | |
employeeID: String, | |
works: [WorkItemSchema], | |
articles: [ArticleSchema] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@meterler @bitdewy
相关xOcean的讨论,以后还是到teambition上吧,这样也便于以后整理和回顾。