Database migration #45

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

Closes

Closes #16
Miroslavsckaya added 1 commit 2022-08-21 13:06:48 +00:00
Miroslavsckaya added 1 commit 2022-08-21 16:17:55 +00:00
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
Miroslavsckaya added 1 commit 2022-08-21 16:28:46 +00:00
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
Miroslavsckaya added 1 commit 2022-08-21 20:15:10 +00:00
Miroslavsckaya added 1 commit 2022-08-21 20:25:20 +00:00
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
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.