Questions tagged [inspectdb]
55 questions
1
vote
0 answers
django DB2 inspectdb failure :'NoneType' object is not subscriptable
my dev environment is in python 3.6 and virtualenv(virtualenv 15.1.0) and with dependencies below:
django 2.2
ibm-db 3.0.1
ibm-db-django 1.2.0.0
as i used "(env_django2) λ python manage.py check", it return "System…

kennymarx0
- 13
- 5
1
vote
1 answer
Django inspectdb not respecting primary key on two columns (postgres)
I am hooking up to an existing Postgres database with Django, using inspectdb to generate my models.py file.
The tables in the Postgres were created like this:
CREATE TABLE "a"
(
"id" uuid NOT NULL DEFAULT…

T.Young
- 45
- 6
1
vote
1 answer
KeyError: 'force_color' error while runing inspectdb in Django
I'm trying to execute inspected command with the exclusion of some tables in Django
I've found this question: How do I inspectdb 1 table from database which Contains 1000 tables similar to mine but the problem is when I run the same code i get a…

Mehdi Selbi
- 147
- 2
- 11
1
vote
1 answer
ProgrammingError: 1064 while executing inspectdb with django and mysql database
I have two databases configured in settings.py:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'USER': 'postgres',
'PASSWORD': 'password',
'HOST': '127.0.0.1',
…

Bogdan Prădatu
- 325
- 5
- 15
1
vote
0 answers
TypeError missing 'base_field' at django inspectdb on ArrayField
django 2.2.1
Legacy database was created via sql code and I want to get model via inspectdb.
The problem column was created as times VARCHAR[]
When I run inspectdb > models.py - execution failed with an error. The models.py file was created as empty…

Vova
- 563
- 8
- 20
1
vote
1 answer
INSPECTDB and INSPECTDB_REFACTOR generate empty models
I have django project and one app.
I haven't models, and I want to generate them from exist postgres database.
I tried python manage.py inspectdb_refactor --database=default --app=igt and python manage.py inspectdb --database=default but for the…

Tyomik_mnemonic
- 786
- 3
- 9
- 31
1
vote
3 answers
ORA-00904: "IDENTITY_COLUMN": invalid identifier error using INSPECTDB DJANGO
I have an existing database in Oracle 11.2.
I am trying to use inspectdb utility of django to automatically create the models but I am getting the error:
ORA-00904: "IDENTITY_COLUMN": invalid identifier
There is no column named IDENTITY_COLUMN in…

KChow
- 317
- 3
- 15
1
vote
1 answer
Why indpectdb in django didn't create all table models?
I have restored the database "AdventureWorks2017" into SQL-Server-2017 , which contains a lot of tables such as:
dbo.AWBuildVersion
dbo.DatabaseLog
dbo.ErrorLog
HumanResources.Department
HumanResources.Employee
...
I am using…

Amir.S
- 719
- 8
- 15
1
vote
1 answer
inspectdb command for json in django2 generates django.contrib.postgresql.fields.JSONField instead of django.contrib.postgres.fields.JSONField?
I switched to django 2 because it supports detecting json fields with inspectdb, but when I run the inspectdb it generates django.contrib.postgresql.fields.JSONField which I don't know where to import it from.
As specified in django documentation…

Erindy
- 155
- 11
1
vote
5 answers
Django inspectdb issue using Oracle database
Installed cx_oracle and ran inspectdb. Don't seem to get any output? Can somebody help? Is there a known issue using inspectdb with Oracle?
Below is the command and settings.py.
python manage.py inspectdb --database xxx_db
# This is an…

Kevin
- 51
- 1
- 3
1
vote
2 answers
django inspectdb 'unique_together' refers to the non-existent field
I have a legacy database that I wish to use as a second database in my django project. I added the database to my settings file, and ran:
python manage.py inspectdb --database=images
The script finished in less than a second, and the results were…

excyberlabber
- 629
- 1
- 10
- 17
1
vote
1 answer
Django legacy db and foreign keys
I'm working with a legacy mysql db with from a php project that is active so I can't change its schema, I've used inspectdb to create the models, now I want to add foreign keys to the models that aren't present , is there a way to do that without…

Pablo K
- 125
- 1
- 10
1
vote
1 answer
Working with primary key field in legacy database using Django
I have to create a simple CRUD panel for an active MySQL database. When I try to migrate my application I receive the following error:
AssertionError: A model can't have more than one Autofield
I've read the following in The Django Book, Chapter…

MiniGunnR
- 5,590
- 8
- 42
- 66
1
vote
1 answer
Django inspectdb miss POSTGRESQL materialized views
All other tables are correctly converted to models but both the views and the materialized views seems to be skipped.
Am I missing something or views and materialized views aren't managed by
./manage.py inspectdb
?

user2239318
- 2,578
- 7
- 28
- 50
1
vote
0 answers
Django: inspectdb doesn't generate all of my tables into models?
I have a file - "codemets.db", which contains a lot of tables and data for my project. Some of the tables are:
- auth_group
- auth_group_permissions
- auth_user
- auth_user_groups
- ...
- mappingapp_coordinates
- ...
I…

CCSoti
- 11
- 2