delete IF NOT EXISTS in create table sql queries
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
mitsuha_s 2022-08-21 19:28:38 +03:00
parent dfa0a137ba
commit 5aa544cc9c

View file

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