この会話は、活動がないためロックされています。新しい投稿を作成してください。
この会話は、活動がないためロックされています。新しい投稿を作成してください。
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>
解決済! 解決策の投稿を見る。
表示
返信
いいね!の合計
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"/>
表示
返信
いいね!の合計
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;
表示
返信
いいね!の合計
Hi All
Thanks for the reply, it seems the correct approach is as following
表示
返信
いいね!の合計