Skip to content
This repository has been archived by the owner on Jan 8, 2021. It is now read-only.

[ADD] 세부 권한 설정 #76

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 13 additions & 0 deletions src/models/Permission.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Sequelize, DataTypes, Model, BuildOptions } from 'sequelize';

interface PermissionAttribute extends Model {
}

type PermissionStatic = typeof Model & {
new (values?: object, options?: BuildOptions): PermissionAttribute;
};

export const PermissionFactory = (sequelize: Sequelize) => {
return <PermissionStatic>sequelize.define('Permission', {
});
};
5 changes: 4 additions & 1 deletion src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ import { PostFactory } from './Post';
import { LaptopArchiveFactory } from './LaptopArchive';

import { db, userDb } from './setting';
import {PermissionFactory} from "./Permission";

const sequelize = new Sequelize(db);

const sequelizeUser = new Sequelize(userDb);

const laptop = LaptopArchiveFactory(sequelize);
const music = MusicArchiveFactory(sequelize);
const permission = PermissionFactory(sequelize);
const post = PostFactory(sequelize);
const scoreArchive = ScoreArchiveFactory(sequelize);

const user = UserFactory(sequelizeUser);
const laptop = LaptopArchiveFactory(sequelize);

const sync = sequelize.createSchema(db.database, {}).then(() => {
return sequelize.sync();
Expand All @@ -33,6 +35,7 @@ export {
Sequelize,
waitForSync,
laptop,
permission,
post,
scoreArchive,
music,
Expand Down