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…
Add table
Add a link
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 Loggerimport psycopg2from psycopg2.extensions import connectionfrom psycopg2.extras import DictCursor, DictRowfrom yoyo import read_migrations, get_backendAscending 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 stepsteps = [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