- WIP on database migration
This commit is contained in:
1 parent
f66ac02bcd
commit
5035a65672
6 files changed
+131
-52
No files matched your search
@@ -1,3 +1,5 @@
|
||||
{% use Lean\Console\Lib\Database\ModifierTypeEnum %}
|
||||
|
||||
{% extends "lean-console/base/layout" %}
|
||||
|
||||
{% language.set "lean.storage" %}
|
||||
@@ -44,16 +46,16 @@
|
||||
<div class="col"><span>📄</span> <span>{{ $item->tableName() }}</span></div>
|
||||
<div class="col">{% _ "database.table.fields", [ 'count' => count( $item->fieldList() ) ] %}</div>
|
||||
<div class="col col-grow-2">
|
||||
{% if $context->status[$entity]['query'] %}
|
||||
<code>{{ $context->status[$entity]['query'] }}</code>
|
||||
{% if $context->definition[$entity]['table']->modifier->query %}
|
||||
<code>{{ $context->definition[$entity]['table']->modifier->query }}</code>
|
||||
{% else %}
|
||||
<div>🗸 This table is up-to-date</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
{% switch $context->status[$entity]['msg'] %}
|
||||
{% case 'unexisting' %}
|
||||
{% switch $context->definition[$entity]['table']->modifier->type %}
|
||||
{% case ModifierTypeEnum::Create %}
|
||||
{% php $createAll[] = $entity %}
|
||||
|
||||
<div class="text-right">
|
||||
@@ -61,8 +63,8 @@
|
||||
</div>
|
||||
{% break %}
|
||||
|
||||
{% case 'altering' %}
|
||||
{% php $alter[] = $entity %}
|
||||
{% case ModifierTypeEnum::Alter %}
|
||||
{% php $alterAll[] = $entity %}
|
||||
|
||||
<div class="text-right">
|
||||
<button name="alter" value="{{$entity}}" class="btn-blue">🗸 {% _ 'database.table.alter' %}</button>
|
||||
@@ -80,9 +82,9 @@
|
||||
{% endif %}
|
||||
|
||||
{% if ($alterAll ?? 0) > 1 %}
|
||||
<div class="text-right" style="padding:0.5rem 0">
|
||||
<button name="createAll" value="{{ implode(',', $alterAll) }}" class="btn-red">🗸 {% _ 'database.table.alterAll' %}</button>
|
||||
</div>
|
||||
<div class="text-right" style="padding:0.5rem 0">
|
||||
<button name="alterAll" value="{{ implode(',', $alterAll) }}" class="btn-red">🗸 {% _ 'database.table.alterAll' %}</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% ui.endform %}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user