property value as Union type
This commit is contained in:
parent
e3779a73ff
commit
b849cfa3df
10 changed files with 87 additions and 34 deletions
|
|
@ -11,7 +11,7 @@ defmodule Mv.Repo.Migrations.InitialMigration do
|
|||
create table(:property_types, primary_key: false) do
|
||||
add :id, :uuid, null: false, default: fragment("gen_random_uuid()"), primary_key: true
|
||||
add :name, :text, null: false
|
||||
add :type, :text, null: false
|
||||
add :value_type, :text, null: false
|
||||
add :description, :text
|
||||
add :immutable, :boolean, null: false, default: false
|
||||
add :required, :boolean, null: false, default: false
|
||||
|
|
@ -21,7 +21,7 @@ defmodule Mv.Repo.Migrations.InitialMigration do
|
|||
|
||||
create table(:properties, primary_key: false) do
|
||||
add :id, :uuid, null: false, default: fragment("gen_random_uuid()"), primary_key: true
|
||||
add :value, :text
|
||||
add :value, :map
|
||||
add :member_id, :uuid
|
||||
add :property_type_id, :uuid
|
||||
end
|
||||
|
|
@ -15,14 +15,35 @@ alias Mv.Membership
|
|||
for attrs <- [
|
||||
%{
|
||||
name: "Vorname",
|
||||
type: "string",
|
||||
value_type: :string,
|
||||
description: "Vorname des Mitglieds",
|
||||
immutable: true,
|
||||
required: true
|
||||
},
|
||||
%{
|
||||
name: "Nachname",
|
||||
value_type: :string,
|
||||
description: "Nachname des Mitglieds",
|
||||
immutable: true,
|
||||
required: true
|
||||
},
|
||||
%{
|
||||
name: "Geburtsdatum",
|
||||
value_type: :date,
|
||||
description: "Geburtsdatum des Mitglieds",
|
||||
immutable: true,
|
||||
required: true
|
||||
},
|
||||
%{
|
||||
name: "Bezahlt",
|
||||
value_type: :boolean,
|
||||
description: "Status des Mitgliedsbeitrages des Mitglieds",
|
||||
immutable: true,
|
||||
required: true
|
||||
},
|
||||
%{
|
||||
name: "Email",
|
||||
type: "string",
|
||||
value_type: :string,
|
||||
description: "Email-Adresse des Mitglieds",
|
||||
immutable: true,
|
||||
required: true
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
"custom_indexes": [],
|
||||
"custom_statements": [],
|
||||
"has_create_action": true,
|
||||
"hash": "A0402269CB456075B81CA4CB3A2135A2C88D8B7FD51CD7A23084AA5264FEE344",
|
||||
"hash": "35D45214D6D344B0AF6CFCB69B8682FCB3D382D85883D3D3AAC1AEE7F54FD89A",
|
||||
"identities": [],
|
||||
"multitenancy": {
|
||||
"attribute": null,
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
"references": null,
|
||||
"size": null,
|
||||
"source": "value",
|
||||
"type": "text"
|
||||
"type": "map"
|
||||
},
|
||||
{
|
||||
"allow_nil?": true,
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
"custom_indexes": [],
|
||||
"custom_statements": [],
|
||||
"has_create_action": true,
|
||||
"hash": "F2A42A3427E0428637F465E4F357A3BE21B33231F94CF77B4843084128F6BDA5",
|
||||
"hash": "8CF241CB9E8239511914EDEC96186BB7879529372BD8A4162431CCE9961F4F1B",
|
||||
"identities": [],
|
||||
"multitenancy": {
|
||||
"attribute": null,
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
"primary_key?": false,
|
||||
"references": null,
|
||||
"size": null,
|
||||
"source": "type",
|
||||
"source": "value_type",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
"custom_indexes": [],
|
||||
"custom_statements": [],
|
||||
"has_create_action": true,
|
||||
"hash": "47210108DE1E7B2A20A67205E875B3440526941E61AB95B166976E8CD8AA0955",
|
||||
"hash": "F98A723AE0D20005FBE4205E46ABEE09A88DFF9334C85BADC1FBEEF100F3E25B",
|
||||
"identities": [
|
||||
{
|
||||
"all_tenants?": false,
|
||||
Loading…
Add table
Add a link
Reference in a new issue