question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create migrate script failed

See original GitHub issue

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if any
  • I have reproduced the issue with at least the latest released version of superset
  • I have checked the issue tracker for the same issue and I haven’t found one similar

Superset version

0.15.4

Expected results

the upgrade function in migrations/versions/xx.py should create the tables in models.py

Actual results

the upgrade function in migrations/versions/xx.py' is going to drop tables ab_xxx` in mysql

Steps to reproduce

There are too many files in migrations/versions/, so i want to re-generate the migrate py.

  1. rm -r migrations/
  2. superset db init
    this step generates folder migrations/ and others, and serveal tables ab_xxx in mysql
  3. superset db migrate -m "initial migration" this step generates a py in migrations/versions/, but its upgrade function is drop these tables ab_, not creating tables in models.py

what’s wrong with my operations?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gbriancommented, Jun 4, 2019

Hi, Having the issue:

sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near "ALTER": syntax error
[SQL: ALTER TABLE annotation ALTER COLUMN layer_id SET NOT NULL]

It happens without any change. layer_id column at annotation table is defined:

layer_id = Column(Integer, ForeignKey('annotation_layer.id'), nullable=False)

Question: Is it save to commit the generated script? If not what’s the preferred DB engine for development? Currently using sqlite3

0reactions
mistercrunchcommented, Apr 23, 2018

Notice: this issue has been closed because it has been inactive for 401 days. Feel free to comment and request for this issue to be reopened.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating migration scripts fails since upgrade to .net5 ... - GitHub
Im running the script from soultion root folder. dotnet ef migrations script -p EF.Core.Failure/EF.Core.Failure.csproj -s EF.Core.Failure/ ...
Read more >
Dealing with Failed SQL Migrations in MariaDB or MySQL
We can develop a rollback script, in tandem, for when things go wrong. I'll discuss how we might generate undo code for a...
Read more >
Problem Creating SQL*Developer Migration Repository
Trying to create a SQL*Developer Migration Repository using an Oracle account (Oracle Database 11gR2 and 12c ) fails with the following message:.
Read more >
EF Core idempotent migration script fails despite check on ...
Script doesn't fail on local SQL dev database. A dozen migrations have been applied since then, and only now the script fails. Below...
Read more >
Migration script fails when you upgrade Data Virtualization - IBM
When you upgrade Data Virtualization, you might encounter errors when you run the migration script.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found