Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change in sqlite3 breaks fixtures #14

Open
moellering opened this issue Oct 22, 2019 · 1 comment
Open

change in sqlite3 breaks fixtures #14

moellering opened this issue Oct 22, 2019 · 1 comment

Comments

@moellering
Copy link

What happened?

pipenv run ./manage.py initialize_shop_demo crashes with the error
django.db.utils.OperationalError: Problem installing fixtures: no such table: filer_folder__old

What should've happened instead?

pipenv run ./manage.py initialize_shop_demo should install the fixtures

Steps to reproduce

mkvirtualenv cookiecutter-django-shop
pip install pipenv cookiecutter autopep8
cookiecutter https://github.com/awesto/cookiecutter-django-shop 

confirm standart settings

cd my-shop
pipenv install --sequential
npm install
pipenv run ./manage.py initialize_shop_demo

Host system configuration

Arch Linux

python --version
Python 3.7.4

sqlite3 --version
3.30.0 2019-10-04 15:03:17 c20a35336432025445f9f7e289d0cc3e4003fb17f45a4ce74c6269c407c6e09f

pip freeze
arrow==0.15.2
autopep8==1.4.4
Babel==2.7.0
binaryornot==0.4.4
certifi==2019.9.11
chardet==3.0.4
Click==7.0
cookiecutter==1.6.0
defusedxml==0.6.0
Django==1.11.25
django-admin-sortable2==0.7.3
django-allauth==0.40.0
django-angular==2.2.3
django-appconf==1.0.3
django-classy-tags==0.9.0
django-cms==3.5.3
django-filer==1.5.0
django-filter==2.2.0
django-formtools==2.1
django-fsm==2.6.1
django-fsm-admin==1.2.4
django-haystack==2.8.1
django-ipware==2.1.0
django-js-asset==1.2.2
django-mptt==0.10.0
django-parler==2.0
django-parler-rest==2.0
django-phonenumber-field==3.0.1
django-polymorphic==1.3.1
django-post-office==3.2.1
django-rest-auth==0.9.5
django-sass-processor==0.7.3
django-sekizai==1.0.0
django-select2==6.3.1
django-shop==1.0.2
django-treebeard==4.3
djangocms-admin-style==1.4.0
djangocms-bootstrap==1.1.2
djangocms-cascade==0.19
djangocms-text-ckeditor==3.8.0
djangorestframework==3.8.2
djangoshop-sendcloud==1.0
djangoshop-stripe==1.0
drf-haystack==1.8.6
easy-thumbnails==2.6
elasticsearch==1.7.0
future==0.18.1
html5lib==1.0.1
idna==2.8
Jinja2==2.10.3
jinja2-time==0.2.0
jsonfield==2.0.2
libsass==0.19.3
MarkupSafe==1.1.1
oauthlib==3.1.0
phonenumbers==8.10.21
Pillow==6.2.1
pipenv==2018.11.26
poyo==0.5.0
pycodestyle==2.5.0
python-dateutil==2.8.0
python3-openid==3.1.0
pytz==2019.3
requests==2.22.0
requests-oauthlib==1.2.0
six==1.12.0
stripe==1.53.0
Unidecode==1.0.23
urllib3==1.25.6
virtualenv==16.7.6
virtualenv-clone==0.5.3
webencodings==0.5.1
whichcraft==0.6.1
@moellering
Copy link
Author

moellering commented Oct 22, 2019

Afaik this is a problem with a changed behavior in sqlite3 3.26.0

Django 2.1.5 should has a workaround for this included.

Related Information:

Django Ticket 29182
Stack Overflow Question

Dirty Workaround

Just to be able to load the fixtures and test something else I did the following:

  • open django/db/backends/sqlite3/schema.py in the used environment
  • add the line c.execute('PRAGMA legacy_alter_table = ON') before c.execute('PRAGMA foreign_keys') in the __enter__ method of the DatabaseSchemaEditor.

@moellering moellering changed the title change in sqlite3 change in sqlite3 breaks fixtures Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant