0
Is there any configuration in sgbd that forces the database to set all columns of a table to notnull?
Whenever I import some database or create a table in my BD, all columns receive the value not null. I would like to resolve this.
0
Is there any configuration in sgbd that forces the database to set all columns of a table to notnull?
Whenever I import some database or create a table in my BD, all columns receive the value not null. I would like to resolve this.
Browser other questions tagged mysql
You are not signed in. Login or sign up in order to post.
The standard is
NOT NULL
. If you want to allow null values, you need to specify the column as NULL at the time of table creation (inCREATE TABLE
inside that file you’re importing).– bfavaretto
I specify, but it’s no use. I’m even using Doctrine. And I’m setting the property "nullable=true" and the problem tends to persist. And in addition, the bank that did an import test, had columns with properties set to allow null values, which in my bank were passed to "not null" automatically.
– funke
nullable="true"
is to allow null values– rray
Yes. That was the intention. Allow null values. What is not happening.
– funke
I didn’t get it right. If you are importing tables (from a .sql file, I assume), it wouldn’t be too late for Doctrine to change anything?
– bfavaretto
I’m sorry, I guess I didn’t express myself right. So, I ran two tests. The first I create the class in Doctrine with the properties "nullable=true" (because I want the fields to receive null), however when running Doctrine and creating the table in the database, the columns I set as nullable=true are all found as not null. So I ran another test, this time without using Doctrine, simply imported a database into another database using the dump via Workbench. Fields that were set to null in the imported base were replaced to not null in my database.
– funke