You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2018/04/12 17:41:39 UTC
[incubator-superset] branch master updated: [migrations] Fixing
issue #4810 (#4815)
This is an automated email from the ASF dual-hosted git repository.
maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 2a95d20 [migrations] Fixing issue #4810 (#4815)
2a95d20 is described below
commit 2a95d203adc59037d1b203bb83d041024eb6e9c8
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Thu Apr 12 10:41:36 2018 -0700
[migrations] Fixing issue #4810 (#4815)
---
superset/assets/package-lock.json | 21 +++++++++++++++++++++
superset/migrations/versions/f231d82b9b26_.py | 21 ++++++++++-----------
2 files changed, 31 insertions(+), 11 deletions(-)
diff --git a/superset/assets/package-lock.json b/superset/assets/package-lock.json
new file mode 100644
index 0000000..707bc5c
--- /dev/null
+++ b/superset/assets/package-lock.json
@@ -0,0 +1,21 @@
+{
+ "name": "superset",
+ "version": "0.23.0dev",
+ "lockfileVersion": 1,
+ "requires": true,
+ "dependencies": {
+ "node": {
+ "version": "9.11.0",
+ "resolved": "https://registry.npmjs.org/node/-/node-9.11.0.tgz",
+ "integrity": "sha512-a4HV43+rHSgYaoGVr5PfnpTmiDeL4AmFsXKzRhBbkDLeRjBoQYENHs7mNCHlQRb9VFKRqXD5FDmadQFPznkUuQ==",
+ "requires": {
+ "node-bin-setup": "1.0.6"
+ }
+ },
+ "node-bin-setup": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/node-bin-setup/-/node-bin-setup-1.0.6.tgz",
+ "integrity": "sha512-uPIxXNis1CRbv1DwqAxkgBk5NFV3s7cMN/Gf556jSw6jBvV7ca4F9lRL/8cALcZecRibeqU+5dFYqFFmzv5a0Q=="
+ }
+ }
+}
diff --git a/superset/migrations/versions/f231d82b9b26_.py b/superset/migrations/versions/f231d82b9b26_.py
index 8a2aa1a..8c64f5d 100644
--- a/superset/migrations/versions/f231d82b9b26_.py
+++ b/superset/migrations/versions/f231d82b9b26_.py
@@ -12,7 +12,6 @@ down_revision = 'e68c4473c581'
from alembic import op
import sqlalchemy as sa
-from sqlalchemy.exc import OperationalError
from superset.utils import generic_find_uq_constraint_name
@@ -25,9 +24,6 @@ names = {
'metrics': 'metric_name',
}
-bind = op.get_bind()
-insp = sa.engine.reflection.Inspector.from_engine(bind)
-
def upgrade():
@@ -60,13 +56,16 @@ def downgrade():
)
# Remove the previous missing uniqueness constraints.
+ bind = op.get_bind()
+ insp = sa.engine.reflection.Inspector.from_engine(bind)
+
for table, column in names.items():
with op.batch_alter_table(table, naming_convention=conv) as batch_op:
batch_op.drop_constraint(
- generic_find_uq_constraint_name(
- table,
- {column, 'datasource_id'},
- insp,
- ) or 'uq_{}_{}'.format(table, column),
- type_='unique',
- )
+ generic_find_uq_constraint_name(
+ table,
+ {column, 'datasource_id'},
+ insp,
+ ) or 'uq_{}_{}'.format(table, column),
+ type_='unique',
+ )
--
To stop receiving notification emails like this one, please contact
maximebeauchemin@apache.org.