Database migration #45

Merged
Miroslavsckaya merged 8 commits from database_migration into master 2022-08-21 20:43:36 +00:00
Showing only changes of commit 5aa544cc9c - Show all commits

View file

@ -1,17 +1,17 @@
from yoyo import step
steps = [
step('CREATE TABLE IF NOT EXISTS users (id SERIAL PRIMARY KEY, telegram_id INTEGER NOT NULL UNIQUE)'),
step('CREATE TABLE IF NOT EXISTS 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 IF NOT EXISTS subscriptions ('
'CREATE TABLE subscriptions ('
' user_id INTEGER REFERENCES users,'
' feed_id INTEGER REFERENCES feeds,'
' UNIQUE (user_id, feed_id)'
')'
),
step(
'CREATE TABLE IF NOT EXISTS feeds_last_items ('
'CREATE TABLE feeds_last_items ('
' feed_id INTEGER REFERENCES feeds ON DELETE CASCADE,'
' url TEXT NOT NULL,'
' guid TEXT'