From f5c46617e377899ff61a38c80150ab53d2b33edc Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Thu, 15 Jan 2015 18:50:05 +0100 Subject: adding news fields and migrations scripts --- migrations/versions/4b5c161e1ced_.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 migrations/versions/4b5c161e1ced_.py (limited to 'migrations/versions') diff --git a/migrations/versions/4b5c161e1ced_.py b/migrations/versions/4b5c161e1ced_.py new file mode 100644 index 00000000..e740e827 --- /dev/null +++ b/migrations/versions/4b5c161e1ced_.py @@ -0,0 +1,32 @@ +"""empty message + +Revision ID: 4b5c161e1ced +Revises: None +Create Date: 2015-01-17 01:04:10.187285 + +""" + +# revision identifiers, used by Alembic. +revision = '4b5c161e1ced' +down_revision = None + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + ### commands auto generated by Alembic - please adjust! ### + op.add_column('feed', sa.Column('error_count', sa.Integer(), nullable=True)) + op.add_column('feed', sa.Column('last_error', sa.String(), nullable=True)) + op.add_column('feed', sa.Column('last_refreshed', sa.DateTime(), 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_refreshed') + op.drop_column('feed', 'last_error') + op.drop_column('feed', 'error_count') + ### end Alembic commands ### -- cgit From 4f0ad9e442e64f69d420dea4d737805eefaaf981 Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Wed, 21 Jan 2015 14:07:00 +0100 Subject: continuing refacto --- migrations/versions/48f561c0ce6_add_column_entry_id.py | 2 +- migrations/versions/4b5c161e1ced_.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'migrations/versions') 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 index e740e827..1efb5f81 100644 --- a/migrations/versions/4b5c161e1ced_.py +++ b/migrations/versions/4b5c161e1ced_.py @@ -1,4 +1,4 @@ -"""empty message +"""adding feed and user attributes for better feed retreiving Revision ID: 4b5c161e1ced Revises: None @@ -8,7 +8,7 @@ Create Date: 2015-01-17 01:04:10.187285 # revision identifiers, used by Alembic. revision = '4b5c161e1ced' -down_revision = None +down_revision = '48f561c0ce6' from alembic import op import sqlalchemy as sa @@ -18,15 +18,19 @@ def upgrade(): ### commands auto generated by Alembic - please adjust! ### op.add_column('feed', sa.Column('error_count', sa.Integer(), nullable=True)) op.add_column('feed', sa.Column('last_error', sa.String(), nullable=True)) - op.add_column('feed', sa.Column('last_refreshed', sa.DateTime(), nullable=True)) + op.add_column('feed', sa.Column('last_modified', sa.DateTime(), nullable=True)) + op.add_column('feed', sa.Column('etag', sa.String(), nullable=True)) op.add_column('user', sa.Column('refresh_rate', sa.Integer(), nullable=True)) + op.add_column('article', sa.Column('guid', sa.String(), 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_refreshed') + op.drop_column('feed', 'last_modified') op.drop_column('feed', 'last_error') op.drop_column('feed', 'error_count') + op.drop_column('feed', 'etag') + op.drop_column('article', 'guid') ### end Alembic commands ### -- cgit From 5572851eca3b2f1bc56aed7232284acc436d2f49 Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Sun, 1 Mar 2015 03:20:12 +0100 Subject: new crawler with cache control and error handling --- migrations/versions/4b5c161e1ced_.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'migrations/versions') diff --git a/migrations/versions/4b5c161e1ced_.py b/migrations/versions/4b5c161e1ced_.py index 1efb5f81..1fa91717 100644 --- a/migrations/versions/4b5c161e1ced_.py +++ b/migrations/versions/4b5c161e1ced_.py @@ -5,6 +5,7 @@ Revises: None Create Date: 2015-01-17 01:04:10.187285 """ +from datetime import datetime # revision identifiers, used by Alembic. revision = '4b5c161e1ced' @@ -15,22 +16,27 @@ import sqlalchemy as sa def upgrade(): - ### commands auto generated by Alembic - please adjust! ### - op.add_column('feed', sa.Column('error_count', sa.Integer(), nullable=True)) + 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)) + 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)) - op.add_column('article', sa.Column('guid', sa.String(), nullable=True)) - ### end Alembic commands ### + op.add_column('user', sa.Column('refresh_rate', sa.Integer(), + nullable=True)) + # end Alembic commands ### def downgrade(): - ### commands auto generated by Alembic - please adjust! ### + # 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') - op.drop_column('article', 'guid') - ### end Alembic commands ### + # end Alembic commands ### -- cgit From bb60a17f7bff315ef6b375f38d49d7200fb8f0c5 Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Wed, 4 Mar 2015 00:01:45 +0100 Subject: adding refresh rate to the profile form --- migrations/versions/4b5c161e1ced_.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'migrations/versions') diff --git a/migrations/versions/4b5c161e1ced_.py b/migrations/versions/4b5c161e1ced_.py index 32cfe8c8..6f591e7e 100644 --- a/migrations/versions/4b5c161e1ced_.py +++ b/migrations/versions/4b5c161e1ced_.py @@ -27,7 +27,7 @@ def upgrade(): 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)) + nullable=True, default=60)) # end Alembic commands ### -- cgit