Skip to content

Commit

Permalink
Merge branch 'master' of github.com:scandipwa/slider
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredsgenkins committed Nov 5, 2020
2 parents f73f9af + 3099e48 commit af966fa
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 70 deletions.
142 changes: 73 additions & 69 deletions Setup/UpgradeSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,82 +205,86 @@ protected function addExtraWidthSlideField(SchemaSetupInterface $setup)
);
}


protected function addExtraImageField(SchemaSetupInterface $setup)
{
$setup->getConnection()->changeColumn(
$setup->getTable('scandiweb_slider_slide'),
'image',
'desktop_image',
[
'type' => Table::TYPE_TEXT,
'length' => 255,
'nullable' => true,
'comment' => 'Desktop Image location',
'after' => 'title'
]
);
// Added only one columnName check, because it is impossible for others to not update if one was updated!
if ($setup->getConnection()->tableColumnExists('scandiweb_slider_slide', 'image')) {
$setup->getConnection()->changeColumn(
$setup->getTable('scandiweb_slider_slide'),
'image',
'desktop_image',
[
'type' => Table::TYPE_TEXT,
'length' => 255,
'nullable' => true,
'comment' => 'Desktop Image location',
'after' => 'title'
]
);

$setup->getConnection()->changeColumn(
$setup->getTable('scandiweb_slider_slide'),
'image_2',
'desktop_image_2',
[
'type' => Table::TYPE_TEXT,
'length' => 255,
'nullable' => true,
'comment' => 'Desktop Image 2 location',
'after' => 'embed_code'
]
);
$setup->getConnection()->changeColumn(
$setup->getTable('scandiweb_slider_slide'),
'image_2',
'desktop_image_2',
[
'type' => Table::TYPE_TEXT,
'length' => 255,
'nullable' => true,
'comment' => 'Desktop Image 2 location',
'after' => 'embed_code'
]
);

$setup->getConnection()->changeColumn(
$setup->getTable('scandiweb_slider_slide'),
'image_3',
'desktop_image_3',
[
'type' => Table::TYPE_TEXT,
'length' => 255,
'nullable' => true,
'comment' => 'Desktop Image 3 location',
'after' => 'slide_text_position_2'
]
);
$setup->getConnection()->changeColumn(
$setup->getTable('scandiweb_slider_slide'),
'image_3',
'desktop_image_3',
[
'type' => Table::TYPE_TEXT,
'length' => 255,
'nullable' => true,
'comment' => 'Desktop Image 3 location',
'after' => 'slide_text_position_2'
]
);

$setup->getConnection()->addColumn(
$setup->getTable('scandiweb_slider_slide'),
'mobile_image',
[
'type' => Table::TYPE_TEXT,
'length' => 255,
'nullable' => true,
'comment' => 'Mobile Image location',
'after' => 'desktop_image'
]
);
$setup->getConnection()->addColumn(
$setup->getTable('scandiweb_slider_slide'),
'mobile_image',
[
'type' => Table::TYPE_TEXT,
'length' => 255,
'nullable' => true,
'comment' => 'Mobile Image location',
'after' => 'desktop_image'
]
);

$setup->getConnection()->addColumn(
$setup->getTable('scandiweb_slider_slide'),
'mobile_image_2',
[
'type' => Table::TYPE_TEXT,
'length' => 255,
'nullable' => true,
'comment' => 'Mobile Image 2 location',
'after' => 'desktop_image_2'
]
);
$setup->getConnection()->addColumn(
$setup->getTable('scandiweb_slider_slide'),
'mobile_image_2',
[
'type' => Table::TYPE_TEXT,
'length' => 255,
'nullable' => true,
'comment' => 'Mobile Image 2 location',
'after' => 'desktop_image_2'
]
);

$setup->getConnection()->addColumn(
$setup->getTable('scandiweb_slider_slide'),
'mobile_image_3',
[
'type' => Table::TYPE_TEXT,
'length' => 255,
'nullable' => true,
'comment' => 'Mobile Image 3 location',
'after' => 'desktop_image_3'
]
);
$setup->getConnection()->addColumn(
$setup->getTable('scandiweb_slider_slide'),
'mobile_image_3',
[
'type' => Table::TYPE_TEXT,
'length' => 255,
'nullable' => true,
'comment' => 'Mobile Image 3 location',
'after' => 'desktop_image_3'
]
);
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Scandiweb_Slider">
<module name="Scandiweb_Slider" setup_version="1.0.15">
<sequence>
<module name="Magento_Catalog" />
<module name="Magento_Cms" />
Expand Down

0 comments on commit af966fa

Please sign in to comment.