diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2015-03-01 03:20:12 +0100 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2015-03-03 22:23:02 +0100 |
commit | 5572851eca3b2f1bc56aed7232284acc436d2f49 (patch) | |
tree | b8f425333804ca06a4a16600b4c4c0bfcdf4cff7 /migrations | |
parent | continuing refacto (diff) | |
download | newspipe-5572851eca3b2f1bc56aed7232284acc436d2f49.tar.gz newspipe-5572851eca3b2f1bc56aed7232284acc436d2f49.tar.bz2 newspipe-5572851eca3b2f1bc56aed7232284acc436d2f49.zip |
new crawler with cache control and error handling
Diffstat (limited to 'migrations')
-rw-r--r-- | migrations/versions/4b5c161e1ced_.py | 24 |
1 files changed, 15 insertions, 9 deletions
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 ### |