Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
Migration1679581138RemoveAssociationFields example
public
function
testUpdateDestructiveRemovesColumn
(
)
: void
{
$existed
=
$this
->
columnExists
(
)
;
$tableData
= null;
if
(
$existed
)
{
$tableData
=
$this
->
fetchData
(
)
;
}
else
{
$this
->
addColumn
(
)
;
}
$migration
=
new
Migration1679581138RemoveAssociationFields
(
)
;
$migration
->
updateDestructive
(
$this
->connection
)
;
$migration
->
updateDestructive
(
$this
->connection
)
;
static
::
assertFalse
(
$this
->
columnExists
(
)
)
;
if
(
$existed
)
{
$this
->
addColumn
(
)
;
$this
->
restoreAssociations
(
$tableData
)
;
}
}