-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
495 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,3 +35,5 @@ out/ | |
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
/mysql-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: '3' | ||
# 실행명령어 | ||
# docker-compose -f ./docker-compose.dev.yml up | ||
services: | ||
zzansuni-mysql: | ||
image: mysql | ||
restart: always | ||
volumes: | ||
- ./mysql-data:/var/lib/mysql | ||
ports: | ||
- "3306:3306" | ||
environment: | ||
MYSQL_DATABASE: zzansuni | ||
MYSQL_ROOT_PASSWORD: root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// INSERT INTO challenge_group (cumulative_count, created_at, last_modified_at, content, title, category) | ||
// VALUES (100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', 'This is a sample content', 'Sample Title', 'HEALTH'); | ||
import { fakerKO as faker } from "@faker-js/faker"; | ||
|
||
for(let i=0; i<20; i++) { | ||
const category = ['HEALTH', 'ECHO', 'SHARE', 'VOLUNTEER']; | ||
const selectedCategory = category[Math.floor(Math.random() * category.length)]; | ||
const content = faker.lorem.text().substring(0,254); | ||
const title = faker.lorem.words(3); | ||
|
||
const sql = `(100, '2023-05-31 10:00:00', '2023-05-31 12:00:00', '${content}', '${title}', '${selectedCategory}'),`; | ||
console.log(sql); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { fakerKO as faker } from "@faker-js/faker"; | ||
|
||
for (let i = 0; i < 50; i++) { | ||
const difficulty = faker.number.int({ min: 1, max: 5 }); | ||
const onceExp = faker.number.int({ min: 1, max: 30 }); | ||
const requiredCount = faker.number.int({ min: 5, max: 50 }); | ||
const successExp = faker.number.int({ min: 10, max: 100 }); | ||
const challengeGroupId = faker.number.int({ min: 1, max: 20 }); | ||
const createdAt = faker.date.past().toISOString().slice(0, 19).replace('T', ' '); | ||
const lastModifiedAt = faker.date.recent().toISOString().slice(0, 19).replace('T', ' '); | ||
const dayTypes = ['DAY', 'MONTH', 'WEEK']; | ||
const dayType = dayTypes[Math.floor(Math.random() * dayTypes.length)]; | ||
|
||
const sql = `(${difficulty}, ${onceExp}, ${requiredCount}, ${successExp}, ${challengeGroupId}, '${createdAt}', '${lastModifiedAt}', '${dayType}'),`; | ||
console.log(sql); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { fakerKO as faker } from "@faker-js/faker"; | ||
|
||
for (let i = 0; i < 50; i++) { | ||
const rating = faker.number.int({ min: 1, max: 5 }); | ||
const createdAt = faker.date.past().toISOString().slice(0, 19).replace('T', ' '); | ||
const lastModifiedAt = faker.date.recent().toISOString().slice(0, 19).replace('T', ' '); | ||
const userChallengeId = faker.number.int({ min: 1, max: 50 }); | ||
const content = faker.lorem.sentence(); | ||
|
||
const sql = `(${rating}, '${createdAt}', '${lastModifiedAt}', ${userChallengeId}, '${content}'),`; | ||
console.log(sql); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { fakerKO as faker } from "@faker-js/faker"; | ||
|
||
for (let i = 0; i < 50; i++) { | ||
const challengeId = faker.number.int({ min: 1, max: 40 }); | ||
const userId = faker.number.int({ min: 1, max: 20 }); | ||
const createdAt = faker.date.past().toISOString().slice(0, 19).replace('T', ' '); | ||
const lastModifiedAt = faker.date.recent().toISOString().slice(0, 19).replace('T', ' '); | ||
const statuses = ['FINISHED', 'PROCEEDING']; | ||
const status = statuses[Math.floor(Math.random() * statuses.length)]; | ||
|
||
const sql = `(${challengeId}, '${createdAt}', '${lastModifiedAt}', ${userId}, '${status}'),`; | ||
console.log(sql); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { fakerKO as faker } from "@faker-js/faker"; | ||
for(let i = 0; i < 20; i++) { | ||
const name = faker.person.firstName(); | ||
const imageUrl = faker.image.url(); | ||
const randomExp = Math.floor(Math.random() * 100); | ||
const sql = `(${randomExp}, '2023-05-31 10:00:00', '2023-05-31 12:00:00', null, 'test${i}@a.c', '${name}', '$2a$10$h1VlKrjjHSnuRoeCnl1reOh.oaAw6EqxrSMB0FVClpOb1S2D.K.ZK', '${imageUrl}', null, 'USER'),`; | ||
console.log(sql); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { fakerKO as faker } from "@faker-js/faker"; | ||
|
||
for (let i = 0; i < 50; i++) { | ||
const createdAt = faker.date.past().toISOString().slice(0, 19).replace('T', ' '); | ||
const lastModifiedAt = faker.date.recent().toISOString().slice(0, 19).replace('T', ' '); | ||
const userChallengeId = faker.number.int({ min: 1, max: 50 }); | ||
const content = faker.lorem.sentence(); | ||
const imageUrl = faker.image.url(); | ||
const statuses = ['APPROVED', 'REJECTED', 'WAITING']; | ||
const status = statuses[Math.floor(Math.random() * statuses.length)]; | ||
|
||
const sql = `('${createdAt}', '${lastModifiedAt}', ${userChallengeId}, '${content}', '${imageUrl}', '${status}'),`; | ||
console.log(sql); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.