Database migration #45
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Miroslavsckaya/tg_rss_bot#45
Loading…
Reference in a new issue
No description provided.
Delete branch "database_migration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #16
Database migrationto WIP:Database migrationLooks good, but here's a few small points of optional improvement.
@ -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
Ascending sort maybe?
@ -176,3 +160,1 @@
' guid TEXT'
')'
)
def __migrate(self, dsn: str) -> None:
Catch and log some errors maybe? 🙂
@ -0,0 +1,20 @@
from yoyo import step
steps = [
step('CREATE TABLE users (id SERIAL PRIMARY KEY, telegram_id INTEGER NOT NULL UNIQUE)'),
You can add indentation for each table for readability.
Let's merge it 😄
WIP:Database migrationto Database migration