aboutsummaryrefslogtreecommitdiff
path: root/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'migrations')
-rw-r--r--migrations/versions/1b750a389c22_remove_email_notification_column.py7
-rw-r--r--migrations/versions/48f561c0ce6_add_column_entry_id.py2
-rw-r--r--migrations/versions/4b5c161e1ced_.py42
3 files changed, 48 insertions, 3 deletions
diff --git a/migrations/versions/1b750a389c22_remove_email_notification_column.py b/migrations/versions/1b750a389c22_remove_email_notification_column.py
index 5ec748a8..71529855 100644
--- a/migrations/versions/1b750a389c22_remove_email_notification_column.py
+++ b/migrations/versions/1b750a389c22_remove_email_notification_column.py
@@ -10,13 +10,16 @@ Create Date: 2015-02-25 23:01:07.253429
revision = '1b750a389c22'
down_revision = '48f561c0ce6'
+import conf
from alembic import op
import sqlalchemy as sa
def upgrade():
- op.drop_column('feed', 'email_notification')
+ if 'sqlite' not in conf.SQLALCHEMY_DATABASE_URI:
+ op.drop_column('feed', 'email_notification')
def downgrade():
- op.add_column('feed', sa.Column('email_notification', sa.Boolean(), default=False))
+ op.add_column('feed', sa.Column('email_notification', sa.Boolean(),
+ default=False))
diff --git a/migrations/versions/48f561c0ce6_add_column_entry_id.py b/migrations/versions/48f561c0ce6_add_column_entry_id.py
index 3f52a7a9..e5bc5735 100644
--- a/migrations/versions/48f561c0ce6_add_column_entry_id.py
+++ b/migrations/versions/48f561c0ce6_add_column_entry_id.py
@@ -1,7 +1,7 @@
"""add column entry_id
Revision ID: 48f561c0ce6
-Revises:
+Revises:
Create Date: 2015-02-18 21:17:19.346998
"""
diff --git a/migrations/versions/4b5c161e1ced_.py b/migrations/versions/4b5c161e1ced_.py
new file mode 100644
index 00000000..32cfe8c8
--- /dev/null
+++ b/migrations/versions/4b5c161e1ced_.py
@@ -0,0 +1,42 @@
+"""adding feed and user attributes for better feed retreiving
+
+Revision ID: 4b5c161e1ced
+Revises: None
+Create Date: 2015-01-17 01:04:10.187285
+
+"""
+from datetime import datetime
+
+# revision identifiers, used by Alembic.
+revision = '4b5c161e1ced'
+down_revision = '1b750a389c22'
+
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+ unix_start = datetime(1970, 1, 1)
+ # commands auto generated by Alembic - please adjust! ###
+ op.add_column('feed', sa.Column('error_count', sa.Integer(), nullable=True,
+ default=0, server_default="0"))
+ op.add_column('feed', sa.Column('last_error', sa.String(), nullable=True))
+ op.add_column('feed', sa.Column('last_modified', sa.DateTime(),
+ nullable=True, default=unix_start, server_default=str(unix_start)))
+ op.add_column('feed', sa.Column('last_retreived', sa.DateTime(),
+ nullable=True, default=unix_start, server_default=str(unix_start)))
+ op.add_column('feed', sa.Column('etag', sa.String(), nullable=True))
+ op.add_column('user', sa.Column('refresh_rate', sa.Integer(),
+ nullable=True))
+ # end Alembic commands ###
+
+
+def downgrade():
+ # commands auto generated by Alembic - please adjust! ###
+ op.drop_column('user', 'refresh_rate')
+ op.drop_column('feed', 'last_modified')
+ op.drop_column('feed', 'last_error')
+ op.drop_column('feed', 'error_count')
+ op.drop_column('feed', 'last_retreived')
+ op.drop_column('feed', 'etag')
+ # end Alembic commands ###
bgstack15