From 90c93528ec0951555be055f13cca304705e11719 Mon Sep 17 00:00:00 2001 From: mitsuha_s Date: Sun, 21 Aug 2022 23:03:43 +0300 Subject: [PATCH] add indentation in sql queries --- database.py | 2 +- migrations/0000.initial_schema.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/database.py b/database.py index 4c1472d..0b18a19 100644 --- a/database.py +++ b/database.py @@ -2,7 +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 +from yoyo import get_backend, read_migrations from exceptions import DisplayableException from rss import FeedItem diff --git a/migrations/0000.initial_schema.py b/migrations/0000.initial_schema.py index e06b35a..5f4b2a5 100644 --- a/migrations/0000.initial_schema.py +++ b/migrations/0000.initial_schema.py @@ -1,8 +1,17 @@ from yoyo import step steps = [ - step('CREATE TABLE users (id SERIAL PRIMARY KEY, telegram_id INTEGER NOT NULL UNIQUE)'), - step('CREATE TABLE feeds (id SERIAL PRIMARY KEY, url TEXT NOT NULL UNIQUE)'), + step( + 'CREATE TABLE users (' + ' id SERIAL PRIMARY KEY,' + ' telegram_id INTEGER NOT NULL UNIQUE' + ')' + ), + step('CREATE TABLE feeds (' + ' id SERIAL PRIMARY KEY,' + ' url TEXT NOT NULL UNIQUE' + ')' + ), step( 'CREATE TABLE subscriptions (' ' user_id INTEGER REFERENCES users,'