mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Implement unique constraint support (#4467)
* Allow creating unique fields * Allow removing unique constriant * Show unique constraint error as validation error in app
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="form">
|
||||
<div class="field">
|
||||
<div class="label type-label">
|
||||
@@ -139,6 +138,16 @@
|
||||
block
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="field half-right" v-if="fieldData.schema">
|
||||
<div class="label type-label">{{ $t('unique') }}</div>
|
||||
<v-checkbox
|
||||
:input-value="fieldData.schema.is_unique"
|
||||
@change="fieldData.schema.is_unique = $event"
|
||||
:label="$t('value_unique')"
|
||||
block
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -43,6 +43,7 @@ function initLocalStore(collection: string, field: string, type: typeof localTyp
|
||||
default_value: undefined,
|
||||
max_length: undefined,
|
||||
is_nullable: true,
|
||||
is_unique: false,
|
||||
numeric_precision: null,
|
||||
numeric_scale: null,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user