AgileVentures / AgileVentures/asyncvoter-api

Story schema definition

オープン
#22 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
5
フォーク
7
PR マージ指標
PR 指標を取得中

説明

Currently the schema for the Story model provides no actual identifiers or constraints. It is defined as such:

``` js
var mongoose = require('mongoose');
var schema = new mongoose.Schema({
name: 'string',
size: 'string',
url: 'string'
});

var Story = mongoose.model('Story', schema);

module.exports = Story;`
```

In my local version I've redefined it as:

``` js
var mongoose = require('mongoose');

var storySchema = new mongoose.Schema({
name: {
type: String,
required: true,
unique: true // <-- Really?
}
size: String,
url: {
type: String,
required: true,
unique: true // <-- Identifier
}
});

var Stories = mongoose.model('Story', storySchema);

module.exports = Stories;
```

Questions: AFAIK, the URL should be unique, however should the name really be unique? Can one issue be voted on multiple times? (E.g. to address further technical concerns/requirements rather than user ones.)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。