aboutsummaryrefslogtreecommitdiff
path: root/migrations
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-04-07 00:00:37 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-04-07 00:00:37 +0200
commit181ee8dced7cccc687136c6f35faf2bff1d22d23 (patch)
tree7a2aea7553433957be0455694a7b39e91668dd42 /migrations
parentcommit the session after deleting old articles. (diff)
parentFixed merge conflicts. (diff)
downloadnewspipe-181ee8dced7cccc687136c6f35faf2bff1d22d23.tar.gz
newspipe-181ee8dced7cccc687136c6f35faf2bff1d22d23.tar.bz2
newspipe-181ee8dced7cccc687136c6f35faf2bff1d22d23.zip
Fixed merge conflicts.
Diffstat (limited to 'migrations')
-rw-r--r--migrations/versions/2472eddbf44b_update_of_the_user_model.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/migrations/versions/2472eddbf44b_update_of_the_user_model.py b/migrations/versions/2472eddbf44b_update_of_the_user_model.py
new file mode 100644
index 00000000..a0194090
--- /dev/null
+++ b/migrations/versions/2472eddbf44b_update_of_the_user_model.py
@@ -0,0 +1,38 @@
+"""update of the user model
+
+Revision ID: 2472eddbf44b
+Revises: ac35c979311a
+Create Date: 2016-03-01 22:35:03.659694
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '2472eddbf44b'
+down_revision = 'ac35c979311a'
+branch_labels = None
+depends_on = None
+
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+ op.drop_column('user', 'enabled')
+ op.add_column('user', sa.Column('is_active', sa.Boolean(), default=False))
+ op.add_column('user', sa.Column('is_admin', sa.Boolean(), default=False))
+ op.add_column('user', sa.Column('is_api', sa.Boolean(), default=False))
+ op.drop_table('role')
+
+
+
+def downgrade():
+ op.drop_column('user', 'is_active')
+ op.drop_column('user', 'is_admin')
+ op.drop_column('user', 'is_api')
+ op.create_table('role',
+ sa.Column('id', sa.INTEGER(), nullable=False),
+ sa.Column('name', sa.VARCHAR(), nullable=True),
+ sa.Column('user_id', sa.INTEGER(), nullable=True),
+ sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
+ sa.PrimaryKeyConstraint('id'),
+ sa.UniqueConstraint('name'))
bgstack15