{"id":18577371,"url":"https://github.com/pjt3591oo/typeorm-basic-entity-modeling","last_synced_at":"2026-04-26T22:31:19.086Z","repository":{"id":100333627,"uuid":"358238686","full_name":"pjt3591oo/typeorm-basic-entity-modeling","owner":"pjt3591oo","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-20T05:03:35.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-16T01:33:52.365Z","etag":null,"topics":["database","orm","typeorm","typescript"],"latest_commit_sha":null,"homepage":"https://blog.naver.com/pjt3591oo/222310744958","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pjt3591oo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-15T11:44:53.000Z","updated_at":"2021-04-20T05:03:38.000Z","dependencies_parsed_at":"2023-05-13T22:15:19.486Z","dependency_job_id":null,"html_url":"https://github.com/pjt3591oo/typeorm-basic-entity-modeling","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pjt3591oo/typeorm-basic-entity-modeling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjt3591oo%2Ftypeorm-basic-entity-modeling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjt3591oo%2Ftypeorm-basic-entity-modeling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjt3591oo%2Ftypeorm-basic-entity-modeling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjt3591oo%2Ftypeorm-basic-entity-modeling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pjt3591oo","download_url":"https://codeload.github.com/pjt3591oo/typeorm-basic-entity-modeling/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjt3591oo%2Ftypeorm-basic-entity-modeling/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32315711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T21:09:39.134Z","status":"ssl_error","status_checked_at":"2026-04-26T21:09:21.240Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","orm","typeorm","typescript"],"created_at":"2024-11-06T23:28:56.635Z","updated_at":"2026-04-26T22:31:19.067Z","avatar_url":"https://github.com/pjt3591oo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Awesome Project Build with TypeORM\n\n[Relation](https://blog.naver.com/pjt3591oo/222310744958)\n[Active Record](https://blog.naver.com/pjt3591oo/222309864102)\n\n## 더미 데이터\n\n```sql\nINSERT INTO user(firstName, lastName, age) VALUES(\"Mung\", \"1\", 29);\nINSERT INTO user(firstName, lastName, age) VALUES(\"Mung\", \"2\", 29);\nINSERT INTO user(firstName, lastName, age) VALUES(\"Mung\", \"3\", 29);\nINSERT INTO user(firstName, lastName, age) VALUES(\"Mung\", \"4\", 29);\nINSERT INTO user(firstName, lastName, age) VALUES(\"Mung\", \"5\", 29);\nINSERT INTO user(firstName, lastName, age) VALUES(\"Mung\", \"6\", 29);\nINSERT INTO user(firstName, lastName, age) VALUES(\"Mung\", \"7\", 29);\nINSERT INTO user(firstName, lastName, age) VALUES(\"Mung\", \"8\", 29);\nINSERT INTO user(firstName, lastName, age) VALUES(\"Mung\", \"9\", 29);\n```\n\n```sql\nINSERT INTO book(name, count) VALUES(\"Python\", 10);\nINSERT INTO book(name, count) VALUES(\"Javascript\", 10);\nINSERT INTO book(name, count) VALUES(\"Dart\", 11);\nINSERT INTO book(name, count) VALUES(\"Django\", 13);\nINSERT INTO book(name, count) VALUES(\"Express\", 9);\nINSERT INTO book(name, count) VALUES(\"Nest\", 13);\nINSERT INTO book(name, count) VALUES(\"Typescript\", 8);\nINSERT INTO book(name, count) VALUES(\"Flutter\", 0);\nINSERT INTO book(name, count) VALUES(\"Kotlin\", 3);\n```\n\n```sql\nINSERT INTO post(title, view, userId) VALUES(\"Python Hard\", 10, 4);\nINSERT INTO post(title, view, userId) VALUES(\"Javascript Easy\", 10, 4);\nINSERT INTO post(title, view, userId) VALUES(\"Dart Fun!!\", 11, 6);\nINSERT INTO post(title, view, userId) VALUES(\"What is Django\", 13, 6);\nINSERT INTO post(title, view, userId) VALUES(\"Hard Express\", 9, 6);\nINSERT INTO post(title, view, userId) VALUES(\"Easy Nest\", 13, 8);\nINSERT INTO post(title, view, userId) VALUES(\"Complex Typescript\", 8, 8);\nINSERT INTO post(title, view, userId) VALUES(\"Important Flutter\", 0, 9);\nINSERT INTO post(title, view, userId) VALUES(\"Complex Kotlin\", 3, 10);\n```\n\n```sql\nINSERT INTO post(title, view, userId) VALUES(\"Python Hard\", 10, 4);\nINSERT INTO post(title, view, userId) VALUES(\"Javascript Easy\", 10, 4);\nINSERT INTO post(title, view, userId) VALUES(\"Dart Fun!!\", 11, 6);\nINSERT INTO post(title, view, userId) VALUES(\"What is Django\", 13, 6);\nINSERT INTO post(title, view, userId) VALUES(\"Hard Express\", 9, 6);\nINSERT INTO post(title, view, userId) VALUES(\"Easy Nest\", 13, 8);\nINSERT INTO post(title, view, userId) VALUES(\"Complex Typescript\", 8, 8);\nINSERT INTO post(title, view, userId) VALUES(\"Important Flutter\", 0, 9);\nINSERT INTO post(title, view, userId) VALUES(\"Complex Kotlin\", 3, 10);\n```\n\n```sql\nINSERT INTO book_users_user(userId, bookId) VALUES(4, 3);\nINSERT INTO book_users_user(userId, bookId) VALUES(4, 4);\nINSERT INTO book_users_user(userId, bookId) VALUES(4, 5);\nINSERT INTO book_users_user(userId, bookId) VALUES(4, 6);\nINSERT INTO book_users_user(userId, bookId) VALUES(5, 6);\nINSERT INTO book_users_user(userId, bookId) VALUES(5, 4);\nINSERT INTO book_users_user(userId, bookId) VALUES(5, 7);\nINSERT INTO book_users_user(userId, bookId) VALUES(6, 10);\nINSERT INTO book_users_user(userId, bookId) VALUES(6, 11);\n```\n\n## 테이블 삭제\n\n```sql\n\u003e DROP TABLE book;\n\u003e DROP TABLE borrow;\n\u003e DROP TABLE post;\n\u003e DROP TABLE user;\n```\n\n## 마이그레이션\n\n`타임스탬프-[-n 옵션].ts` 마이그레이션 파일 생성\n\n* 마이그레이션 생성(generate)\n\n```sh\n$ ts-node ./node_modules/typeorm/cli.js migration:generate -n MigrationFileName\n```\n\n스키마(entity) 변동이 없다면 마이그레이션 생성하지 않음. 다음과 같이 경고문 출력\n\n```\nNo changes in database schema were found - cannot generate a migration. To create a new empty migration use \"typeorm migration:create\" command\n```\n\n* 마이그레이션 생성(create)\n\n```sh\n$ ts-node ./node_modules/typeorm/cli.js migration:create -n MigrationFileName\n```\n\n스키마(entity) 변동이 없어도 마이그레이션 생성\n\n* 실행(run)\n\n```sh\n$ ts-node ./node_modules/typeorm/cli.js migration:run\n```\n\n* 되돌리기(revert)\n\n```sh\n$ ts-node ./node_modules/typeorm/cli.js migration:revert\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjt3591oo%2Ftypeorm-basic-entity-modeling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpjt3591oo%2Ftypeorm-basic-entity-modeling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjt3591oo%2Ftypeorm-basic-entity-modeling/lists"}