-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- PostgreSQL接続の設定を有効化し、SQLite3の接続をコメントアウトしました。 - スキーマのオブジェクト名を変更し、新しいフィールドを追加しました(例: UserTable, PostTable)。 - シーダーのロジックを改善し、非同期処理を適切に使用しました。 - 不要なコメントを削除し、コードの可読性を向上させました。
- Loading branch information
1 parent
0d53bb6
commit 8694d41
Showing
8 changed files
with
72 additions
and
59 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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
nim c -d:reset ./migrations/migrate.nim | ||
# nim c database/seeder/develop | ||
nim c ./seeder/develop | ||
|
||
./migrations/migrate | ||
# APP_ENV=develop ./database/seeder/develop | ||
./seeder/develop |
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,5 @@ | ||
nim c ./migrations/migrate.nim | ||
nim c database/seeder/production | ||
|
||
./migrations/migrate | ||
APP_ENV=production ./database/seeder/production |
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 |
---|---|---|
@@ -1,60 +1,60 @@ | ||
import std/json | ||
|
||
type IntRelation* = object | ||
type IntRelationTable* = object | ||
## IntRelation | ||
id*: int | ||
|
||
|
||
type StrRelation* = object | ||
type StrRelationTable* = object | ||
## StrRelation | ||
uuid*: string | ||
|
||
|
||
type User* = object | ||
type UserTable* = object | ||
## user | ||
created_at*: int | ||
email*: string | ||
id*: string | ||
name*: string | ||
email*: string | ||
password*: string | ||
created_at*: int | ||
updated_at*: int | ||
|
||
|
||
type PostTable* = object | ||
## post | ||
id*: string | ||
title*: string | ||
content*: string | ||
user_id*: string | ||
created_at*: int | ||
updated_at*: int | ||
|
||
|
||
type Types* = object | ||
type TypesTable* = object | ||
## Types | ||
id*: int | ||
integer*: int | ||
smallInteger*: int | ||
mediumInteger*: int | ||
bigInteger*: int | ||
binary*: string | ||
boolean*: bool | ||
char*: string | ||
created_at*: string | ||
date*: string | ||
datetime*: string | ||
decimal*: float | ||
deleted_at*: string | ||
double*: float | ||
enumField*: string | ||
float*: float | ||
id*: int | ||
int_relation_id*: string | ||
integer*: int | ||
json*: JsonNode | ||
longText*: string | ||
mediumInteger*: int | ||
mediumText*: string | ||
smallInteger*: int | ||
str_relation_id*: string | ||
uuid*: string | ||
char*: string | ||
string*: string | ||
text*: string | ||
mediumText*: string | ||
longText*: string | ||
date*: string | ||
datetime*: string | ||
timestamp*: string | ||
created_at*: string | ||
updated_at*: string | ||
uuid*: string | ||
|
||
|
||
type Post* = object | ||
## post | ||
content*: string | ||
created_at*: int | ||
id*: string | ||
title*: string | ||
updated_at*: int | ||
user_id*: string | ||
deleted_at*: string | ||
binary*: string | ||
boolean*: bool | ||
enumField*: string | ||
json*: JsonNode | ||
int_relation_id*: int | ||
str_relation_id*: string |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,5 @@ proc seed() {.async.} = | |
userSeeder().await | ||
postSeeder().await | ||
|
||
|
||
seed().waitFor() |
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,5 @@ | ||
nim c -d:reset ./migrations/migrate.nim | ||
nim c database/seeder/staging | ||
|
||
./migrations/migrate | ||
APP_ENV=staging ./database/seeder/staging |
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