Database migration #45

Merged
Miroslavsckaya merged 8 commits from database_migration into master 2022-08-21 20:43:36 +00:00

Closes #16

Closes #16
Miroslavsckaya added 1 commit 2022-08-21 13:06:48 +00:00
add database migrations
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
8766e36aa6
Miroslavsckaya added 1 commit 2022-08-21 16:17:55 +00:00
code style changes
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
8d4aa91d6f
Miroslavsckaya changed title from Database migration to WIP:Database migration 2022-08-21 16:18:26 +00:00
Miroslavsckaya added 1 commit 2022-08-21 16:20:39 +00:00
little code style changes
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
dfa0a137ba
Miroslavsckaya added 1 commit 2022-08-21 16:28:46 +00:00
delete IF NOT EXISTS in create table sql queries
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
5aa544cc9c
skobkin approved these changes 2022-08-21 16:50:05 +00:00
skobkin left a comment
Collaborator

Looks good, but here's a few small points of optional improvement.

Looks good, but here's a few small points of **optional** improvement.
database.py Outdated
@ -2,6 +2,7 @@ from logging import Logger
import psycopg2
from psycopg2.extensions import connection
from psycopg2.extras import DictCursor, DictRow
from yoyo import read_migrations, get_backend
Collaborator

Ascending sort maybe?

Ascending sort maybe?
skobkin marked this conversation as resolved
@ -176,3 +160,1 @@
' guid TEXT'
')'
)
def __migrate(self, dsn: str) -> None:
Collaborator

Catch and log some errors maybe? 🙂

Catch and log some errors maybe? 🙂
skobkin marked this conversation as resolved
@ -0,0 +1,20 @@
from yoyo import step
steps = [
step('CREATE TABLE users (id SERIAL PRIMARY KEY, telegram_id INTEGER NOT NULL UNIQUE)'),
Collaborator

You can add indentation for each table for readability.

You can add indentation for each table for readability.
skobkin marked this conversation as resolved
Miroslavsckaya added 1 commit 2022-08-21 20:03:55 +00:00
add indentation in sql queries
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
90c93528ec
Miroslavsckaya added 1 commit 2022-08-21 20:15:10 +00:00
add docstring and logging to Database.__migrate method
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
d3d33bb718
Miroslavsckaya added 1 commit 2022-08-21 20:25:20 +00:00
correct docstrings in database.py
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
52023fcd1a
skobkin approved these changes 2022-08-21 20:35:50 +00:00
skobkin left a comment
Collaborator

Let's merge it 😄

Let's merge it 😄
Miroslavsckaya added 1 commit 2022-08-21 20:39:11 +00:00
code style changes
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
fe2a9cc515
Miroslavsckaya changed title from WIP:Database migration to Database migration 2022-08-21 20:42:04 +00:00
Miroslavsckaya merged commit 31c112a4fa into master 2022-08-21 20:43:36 +00:00
Miroslavsckaya deleted branch database_migration 2022-08-21 20:43:36 +00:00
Miroslavsckaya referenced this pull request from a commit 2022-08-21 20:43:36 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Miroslavsckaya/tg_rss_bot#45
No description provided.