sqlDefault="Null"to no avail, same error.
<element autopk="true" label="Goals" labelSingular="Goal" name="goals"> <attribute label="Foreign key of the recipient" name="recipientId" type="int64"/> <attribute label="No Poverty" name="goal01" sqlDefault="Null" type="byte"/> <attribute label="Zero Hunger" name="goal02" sqlDefault="Null" type="byte"/> <attribute label="Good Health" name="goal03" sqlDefault="Null" type="byte"/> <attribute label="Quality Education" name="goal04" sqlDefault="Null" type="byte"/> <attribute label="Gender Equality" name="goal05" sqlDefault="Null" type="byte"/> <attribute label="Clean Water" name="goal06" sqlDefault="Null" type="byte"/> <attribute label="Affordable Energy" name="goal07" sqlDefault="Null" type="byte"/> <attribute label="Decent Work" name="goal08" sqlDefault="Null" type="byte"/> <attribute label="Industry" name="goal09" sqlDefault="Null" type="byte"/> <attribute label="Reduced Inequalities" name="goal10" sqlDefault="Null" type="byte"/> <attribute label="Sustainable Cities" name="goal11" sqlDefault="Null" type="byte"/> <attribute label="Responsible Consumption" name="goal12" sqlDefault="Null" type="byte"/> <attribute label="Climate Action" name="goal13" sqlDefault="Null" type="byte"/> <attribute label="Life Water" name="goal14" sqlDefault="Null" type="byte"/> <attribute label="Life on Land" name="goal15" sqlDefault="Null" type="byte"/> <attribute label="Peace" name="goal16" sqlDefault="Null" type="byte"/> <attribute label="Partnerships" name="goal17" sqlDefault="Null" type="byte"/> <attribute label="Inclusion" name="Inclusion" sqlDefault="Null" type="byte"/> <attribute label="Health and Wellness" name="HealthWellness" sqlDefault="Null" type="byte"/> <attribute label="Environment" name="Environment" sqlDefault="Null" type="byte"/> <attribute label="Sustainable Infrastructure" name="SustainableInfrastructure" sqlDefault="Null" type="byte"/> <attribute label="Responsible Consumption" name="ResponsibleConsumption" sqlDefault="Null" type="byte"/> <attribute label="People" name="people" sqlDefault="Null" type="byte"/> <attribute label="Planet" name="planet" sqlDefault="Null" type="byte"/> <attribute default="GetDate()" label="Creation date" name="created" type="datetime"/> <attribute label="Modification date" name="lastModified" type="datetime"/> <!--Link--> <element integrity="define" label="Recipient" name="lnkRecipient" revLink="goals" target="nms:recipient" type="link"> <join xpath-dst="@id" xpath-src="@recipientId"/> </element>
Solved! Go to Solution.
Views
Replies
Total Likes
Hi All
Thanks for the reply, it seems the correct approach is as following
Views
Replies
Total Likes
Hello @david--garcia
Can you try adding default="null" in your attribute declaration?
Like this:
<attribute label="No Poverty" name="goal01" default="null" type="byte"/>
Views
Replies
Total Likes
Hi @david--garcia ,
As per my understanding, the SqlDefault set in schema is applied only at the time of creation of that column. So if you have created the goal03 column with an sqlDefault, then it cannot be modified by changing in the schema itself. To change the default value you should run the following SQL
ALTER TABLE <tablename>
ALTER COLUMN <columnname> SET DEFAULT '<default value>';
To drop a default value, you may try the drop default
ALTER TABLE <tablename>
ALTER COLUMN <columnname> DROP DEFAULT;
Views
Replies
Total Likes
Hi All
Thanks for the reply, it seems the correct approach is as following
Views
Replies
Total Likes