Skip to content

Commit

Permalink
🗃️ :: db :: businessTable Setting
Browse files Browse the repository at this point in the history
- table setting
  • Loading branch information
12xii committed Sep 30, 2023
1 parent 4938d93 commit ff2f4ee
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 3 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "test",
"start": "start"
"start": "cd src && ts-node index.ts"
},
"repository": {
"type": "git",
Expand Down
10 changes: 10 additions & 0 deletions src/enums/businessType.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export enum businessType {
yuseongMagic = '유성매직네트워크',
recordImage = '기록 영상',
publicOpinion = '공론',
alleyEconomy = '골목경제',
careSystem = '돌봄체계 구축',
olderLeisure = '노년층 여가활동',
sharePlace = '공유공간 활성화',
livinglab = '리빙랩'
}
5 changes: 5 additions & 0 deletions src/enums/clubType.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export enum clubType {
residentMeeting = '주민모임',
npPrivateOrg = '비영리민간단체',
npCorporation = '비영리법인'
}
3 changes: 3 additions & 0 deletions src/enums/loc.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export enum loc {

}
101 changes: 101 additions & 0 deletions src/models/business.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import { Column, Entity, PrimaryColumn, PrimaryGeneratedColumn } from "typeorm";
import { businessType } from "../enums/businessType.enum.js";
import { clubType } from "../enums/clubType.enum.js";
import { loc } from "../enums/loc.enum.js";

@Entity()
export class Business {
@PrimaryGeneratedColumn()
id!: number;

@Column({
type: 'varchar'
})
businessType!: businessType;

@Column({
type: 'varchar'
})
clubName!: string;

@Column({
type: 'boolean'
})
isContiguous!: boolean;

@Column({
type: 'varchar',
nullable: true
})
contiguousLocation?: loc;

@Column({
type: 'varchar'
})
businessName!: string;

@Column({
type: 'integer'
})
totalBudget!: number;

@Column({
type: 'integer'
})
subsidy!: number;

@Column({
type: 'integer'
})
selfInflicted!: number;

@Column({
type: 'varchar'
})
clubType!: clubType;

@Column({
type: 'integer'
})
countOfManager!: number;

@Column({
type: 'integer',
default: 0
})
countOfMember!: number;

@Column({
type: 'varchar',
nullable: true
})
clubAddress?: string;

@Column({
type: 'integer'
})
clubRegisterNumber!: number;

@Column({
type: 'boolean',
default: false
})
isIncludingInfo!: boolean;

@Column({
type: 'boolean',
default: false
})
isIncludingMemberList!: boolean;

@Column({
type: 'boolean',
default: false
})
isIncludingPlan!: boolean;

@Column({
type: 'integer'
})
year!: number;
}
3 changes: 2 additions & 1 deletion src/models/dataSource.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { configDotenv } from "dotenv";
import "reflect-metadata";
import { DataSource } from "typeorm";
import { Business } from "./business.js";

configDotenv();

Expand All @@ -13,7 +14,7 @@ export const AppDataSource = new DataSource({
database: process.env.DB_NAME,
synchronize: true,
logging: false,
entities: [],
entities: [Business],
migrations: [],
subscribers: [],
});
Empty file removed src/models/index.ts
Empty file.

0 comments on commit ff2f4ee

Please sign in to comment.