diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-03-04 23:13:56 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-03-04 23:13:56 +0100 |
commit | 1af62771c5a15c90b3ca194b7e1c7f23f00ae248 (patch) | |
tree | dc441cba3905034685e2c2499a22ec534073dac9 /migrations | |
parent | Added missing requirement (diff) | |
download | newspipe-1af62771c5a15c90b3ca194b7e1c7f23f00ae248.tar.gz newspipe-1af62771c5a15c90b3ca194b7e1c7f23f00ae248.tar.bz2 newspipe-1af62771c5a15c90b3ca194b7e1c7f23f00ae248.zip |
new migration version script
Diffstat (limited to 'migrations')
-rw-r--r-- | migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py b/migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py new file mode 100644 index 00000000..59834236 --- /dev/null +++ b/migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py @@ -0,0 +1,41 @@ +"""adding feed and user attributes for better feed retreiving + +Revision ID: cde34831ea +Revises: 1b750a389c22 +Create Date: 2015-03-04 22:59:44.665979 + +""" + +# revision identifiers, used by Alembic. +revision = 'cde34831ea' +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_retrieved', 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, default=60)) + # 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_retrieved') + op.drop_column('feed', 'etag') + # end Alembic commands ### |