diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-04-04 00:12:40 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-04 00:12:40 +0900 |
| commit | 9f659271b59ab2747a24b7e05a8ad510255e8916 (patch) | |
| tree | 3c1119e200c3a594c719c848f9a5f50a242fcf03 /src/models/post.ts | |
| parent | Refactor (diff) | |
| parent | Enforce URI uniquness (diff) | |
| download | misskey-9f659271b59ab2747a24b7e05a8ad510255e8916.tar.gz misskey-9f659271b59ab2747a24b7e05a8ad510255e8916.tar.bz2 misskey-9f659271b59ab2747a24b7e05a8ad510255e8916.zip | |
Merge pull request #1386 from akihikodaki/uri
Enforce URI uniquness
Diffstat (limited to 'src/models/post.ts')
| -rw-r--r-- | src/models/post.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/models/post.ts b/src/models/post.ts index 798c18e4b1..2f2b51b946 100644 --- a/src/models/post.ts +++ b/src/models/post.ts @@ -11,6 +11,8 @@ import { pack as packFile } from './drive-file'; const Post = db.get<IPost>('posts'); +Post.createIndex('uri', { sparse: true, unique: true }); + export default Post; export function isValidText(text: string): boolean { @@ -49,6 +51,7 @@ export type IPost = { heading: number; speed: number; }; + uri: string; }; /** |