Fix scale/precision not saving properly

Fixes #3368
This commit is contained in:
rijkvanzanten
2020-12-14 19:28:14 -05:00
parent fde6125400
commit 83b003b5ff
3 changed files with 17 additions and 51 deletions

View File

@@ -52,9 +52,8 @@
<div class="field half" v-if="fieldData.schema">
<div class="label type-label">{{ $t('precision_scale') }}</div>
<div class="precision-scale">
<v-input type="number" :placeholder="10" v-model="fieldData.schema.precision" />
<v-input type="number" :placeholder="5" v-model="fieldData.schema.scale" />
<v-input type="number" :placeholder="10" v-model="fieldData.schema.numeric_precision" />
<v-input type="number" :placeholder="5" v-model="fieldData.schema.numeric_scale" />
</div>
</div>
</template>
@@ -129,13 +128,7 @@
},
]"
/>
<v-input
v-else
class="monospace"
v-model="defaultValue"
disabled
:placeholder="$t('add_a_default_value')"
/>
<v-input v-else class="monospace" v-model="defaultValue" disabled :placeholder="$t('add_a_default_value')" />
</div>
<div class="field half-left" v-if="fieldData.schema">

View File

@@ -37,8 +37,8 @@ function initLocalStore(collection: string, field: string, type: typeof localTyp
default_value: undefined,
max_length: undefined,
is_nullable: true,
precision: null,
scale: null,
numeric_precision: null,
numeric_scale: null,
},
meta: {
hidden: false,