Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyejung #7

Merged
merged 8 commits into from
May 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/loaders/db.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import mongoose from 'mongoose';
import config from '../config';
import Period from '../models/Period';
import Quantity from '../models/Quantity';
import Review from '../models/Review';
import Subscribe from '../models/Subscribe';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋นผ๋จน์€ ๋กœ๋” ์ž˜ ์ฑ™๊ฒจ์ฃผ์…”์„œ ๊ฐ์‚ผ๋‹น~! ๐Ÿ‘


const connectDB = async () => {
try {
Expand All @@ -15,6 +19,22 @@ const connectDB = async () => {
mongoose.set('autoIndex', true);

console.log('Mongoose Connected ...');

Period.createCollection().then(collection => {
console.log('Period collection is created!!');
});

Quantity.createCollection().then(collection => {
console.log('Quantity collection is created!!');
});

Review.createCollection().then(collection => {
console.log('Review collection is created!!');
});

Subscribe.createCollection().then(collection => {
console.log('Subscribe collection is created!!');
});
} catch (err: any) {
console.error(err.message);
process.exit(1);
Expand Down