| 作成者 | {{config.author}} | {% endif -%}作成日 | {{date | date(format="%x", locale=locale)}} |
|---|
| No. | モデルグループ |
|---|---|
| {{loop.index}} | {{group.group_def.label | default(value=group.group_name) }} |
| 更新日 | 変更内容 |
|---|---|
| {{row.date | date(format="%x", locale=locale)}} | {{- description | safe -}} |
| モデルグループ | {{group.group_def.label | default(value=group.group_name) }} | {% endif -%} {% if config.author -%}作成者 | {{config.author}} | {% endif -%}作成日 | {{date | date(format="%x", locale=locale)}} |
|---|
| No. | テーブル名 |
|---|---|
| {{loop.index}} | {{model_name}} {%- if model.label %} ({{model.label}}){% endif %} |
物理テーブル名: {{model.table_name}}
{% if model.comment -%}| No. | 論理名 | 物理名 | データ型 | Null | 長さ | 主 | 備考 |
|---|---|---|---|---|---|---|---|
| {{loop.index}} | {{column | get(key="label", default="")}} | {{column | get(key="column_name", default=name)}} | {% if column.signed %}signed {% endif %}{{column.type}} | {% if not column.not_null %}Y{% endif %} | {%- if column.length %}{{column.length}}{% endif %} {%- if column.precision %}{{column.precision}}{% endif %} {%- if column.scale %},{{column.scale}}{% endif %} | {% if column.primary %}Y{% endif %} |
{%- if column.enum_values -%}
{% for enum in column.enum_values -%}
{%- if enum.value is defined %}
{{enum.value}}:{{enum | get(key="label", default=enum.name) }}
{%- else %}
{{enum.name}}{% if enum.label %}:{{enum.label}}{% endif %}
{%- endif %}
{%- if enum.comment %} ({{enum.comment}}){% endif %}
{%- if not loop.last %} {{column.comment}}{% endif -%}
|
データ型に signed の指定がない場合、 double, decimal 等も含めすべての数値型は unsigned。
| No. | タイプ | カラム |
|---|---|---|
| {{loop.index}} | {%- if index %}{{index | get(key="type", default="INDEX") | upper}} {%- else %}INDEX{% endif %} | {%- if index and index.fields %}{% for name, field in index.fields -%} {%- if field and field.query %}({{field.query}}){% else %}{{name}}{%- if field and field.length %}({{field.length}}){% endif %}{% endif %} {%- if not loop.last %}, {% endif %} {%- endfor %}{% else %}{{name}}{% endif %} |
| No. | 名前 | カラム | タイプ | 結合先 | 結合先カラム | 削除時 |
|---|---|---|---|---|---|---|
| {{loop.index}} | {{relation | get(key="label", default=name)}} | {%- if relation.local %}{{relation.local | join(sep=", ")}}{% else %}
{%- if type == "has_many" or type == "has_one" %} - {% else %}{{name}}_id{% endif %}
{%- endif %} |
{{type | upper}} | {{- relation.model | split(pat="::") | last}} | {%- if relation.foreign %}{{relation.foreign | join(sep=", ")}}{% else %}
{%- if type == "has_many" %}{{model_name}}_id{% else %} - {% endif %}
{%- endif %} |
{{relation | get(key="on_delete", default="")}} |
カラムの - は主キー。{%- if config.ignore_foreign_key %}実際にはデータベースに外部キー制約は設定しない。{% endif -%}
{{model.comment}}