Skip to content

Commit

Permalink
Add drop and create all FKs button to EntityList screen
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesde committed Oct 26, 2018
1 parent 5db310e commit 6551de8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions base-component/tools/screen/Tools/Entity/DataEdit/EntityList.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ along with this software (see the LICENSE.md file). If not, see
]]></script></actions>
<default-response type="none"/>
</transition>
<transition name="dropForeignKeys" begin-transaction="false">
<actions>
<script>ec.entity.entityDbMeta.forceCheckExistingTables()</script>
<set field="dropped" from="ec.entity.getEntityDbMeta().dropAllForeignKeys()"/>
<message>Dropped ${dropped} foreign keys</message>
</actions>
<default-response url="."/>
</transition>
<transition name="createForeignKeys" begin-transaction="false">
<actions>
<set field="created" from="ec.entity.getEntityDbMeta().createForeignKeysForExistingTables()"/>
<message>Created ${created} foreign keys</message>
</actions>
<default-response url="."/>
</transition>

<actions>
<set field="pageSize" from="pageSize ?: 60"/>
Expand All @@ -38,6 +53,8 @@ along with this software (see the LICENSE.md file). If not, see
</actions>
<widgets>
<link url="checkTables" text="Check/Update All Tables"/>
<link url="dropForeignKeys" text="Drop FKs" confirmation="Really drop all known foreign keys?"/>
<link url="createForeignKeys" text="Create FKs" confirmation="Really create all missing foreign keys?"/>
<container-dialog id="LiquibaseInitDialog" button-text="Liquibase Init XML">
<form-single name="LiquibaseInit" transition="getLiquibaseInitXml">
<field name="filterRegexp"><default-field><text-line size="40"/></default-field></field>
Expand Down
2 changes: 1 addition & 1 deletion base-component/tools/screen/Tools/Entity/DataSnapshot.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ along with this software (see the LICENSE.md file). If not, see
</form-single>
</container-dialog>
<link url="dropForeignKeys" text="Drop FKs" confirmation="Really drop all known foreign keys?"/>
<link url="createForeignKeys" text="Create FKs" confirmation="Really create all foreign keys?"/>
<link url="createForeignKeys" text="Create FKs" confirmation="Really create all missing foreign keys?"/>

<label text="Current Snapshot Files" type="h4"/>
<section-iterate name="SnapshotListSection" list="snapshotList" entry="sfile"><widgets>
Expand Down

0 comments on commit 6551de8

Please sign in to comment.