Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2016-03-12 15:35:38 -0800
committerChristopher Allan Webber <cwebber@dustycloud.org>2016-03-26 11:39:07 -0700
commitc82716c85310401aa107816c04adfc352d70ba03 (patch)
treefa447c5fe5c3b2dabb8f32c1e4689fafe951ef18
parent90779509bbe65ab56dd137ffb9d5019f498e79e1 (diff)
Persona plugin initial migration.
* mediagoblin/plugins/persona/migrations/c7d4840a5592_persona_plugin_initial_migration.py: New file.
-rw-r--r--mediagoblin/plugins/persona/migrations/c7d4840a5592_persona_plugin_initial_migration.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/mediagoblin/plugins/persona/migrations/c7d4840a5592_persona_plugin_initial_migration.py b/mediagoblin/plugins/persona/migrations/c7d4840a5592_persona_plugin_initial_migration.py
new file mode 100644
index 00000000..0c40893a
--- /dev/null
+++ b/mediagoblin/plugins/persona/migrations/c7d4840a5592_persona_plugin_initial_migration.py
@@ -0,0 +1,35 @@
+"""Persona plugin initial migration
+
+Revision ID: c7d4840a5592
+Revises: 52bf0ccbedc1
+Create Date: 2016-03-12 23:30:33.624390
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = 'c7d4840a5592'
+down_revision = '52bf0ccbedc1'
+branch_labels = ('persona_plugin',)
+depends_on = None
+
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+ if op.get_bind().engine.has_table('persona__user_emails'):
+ # Skip; this has already been instantiated
+ # (probably via sqlalchemy-migrate)
+ return
+
+ op.create_table(
+ 'persona__user_emails',
+ sa.Column('id', sa.Integer(), nullable=False),
+ sa.Column('persona_email', sa.Unicode(), nullable=False),
+ sa.Column('user_id', sa.Integer(), nullable=False),
+ sa.ForeignKeyConstraint(['user_id'], ['core__users.id'], ),
+ sa.PrimaryKeyConstraint('id'))
+
+
+def downgrade():
+ op.drop_table('persona__user_emails')