Skip to content

Commit

Permalink
migration: migrate DB running on vps to Render
Browse files Browse the repository at this point in the history
  • Loading branch information
minhtri6179 committed Mar 28, 2024
1 parent 5e863f6 commit 8d7d8ea
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
package-lock.json
app.env
*.csv

/scripts/.venv/
go.sum
go.mod
/GUI
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DB_URL=postgresql://root:secret@localhost:5432/toeic?sslmode=disable
DB_URL=secret
DB_on_cloud=secret
# db url change localhost to name of db container
postgres:
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ require (
github.com/subosito/gotenv v1.4.2 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/arch v0.5.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sync v0.4.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
golang.org/x/arch v0.5.0 h1:jpGode6huXQxcskEIpOCvrU+tzo81b6+oFLUYXWtH/Y=
golang.org/x/arch v0.5.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
Expand Down
5 changes: 4 additions & 1 deletion scripts/create_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def create_answer(self, answer_text_list, question_id_list, is_correct_list):
"answer_text": answer,
"is_correct": is_correct_list[idx],
}
print("POST: ", myobj, "to: ", self.answer)
x = requests.post(self.answer, json=myobj)
answer_ids.append(x.json()["answer_id"])
self.answers_idx = answer_ids
Expand Down Expand Up @@ -76,7 +77,9 @@ def update_answer(self):
answer_list = df["is_true"]
answer_list

test = CreateTestDB("www.ceito.site/questions/", "www.ceito.site/answers/")
test = CreateTestDB(
" https://www.ceito.site/questions/", " https://www.ceito.site/answers/"
)
test.create_question(question_text, "ETS-23-Test1")
questions = test.get_questions()

Expand Down

0 comments on commit 8d7d8ea

Please sign in to comment.