This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from Dolphiq/development
Set url to maximal 1000 characters
- Loading branch information
Showing
5 changed files
with
46 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace dolphiq\redirect\migrations; | ||
|
||
use Craft; | ||
use craft\db\Migration; | ||
|
||
/** | ||
* m190426_121317_change_url_size_to_1000 migration. | ||
*/ | ||
class m190426_121317_change_url_size_to_1000 extends Migration | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public function safeUp() | ||
{ | ||
if ($this->db->tableExists('{{%dolphiq_redirects}}') | ||
&& $this->db->columnExists('{{%dolphiq_redirects}}', 'sourceUrl') | ||
&& $this->db->columnExists('{{%dolphiq_redirects}}', 'destinationUrl') | ||
) { | ||
$this->alterColumn('{{%dolphiq_redirects}}','sourceUrl', $this->string(1000)->notNull()->defaultValue('')); | ||
$this->alterColumn('{{%dolphiq_redirects}}','destinationUrl', $this->string(1000)->notNull()->defaultValue('')); | ||
} | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function safeDown() | ||
{ | ||
echo "m190426_121317_change_url_size_to_1000 cannot be reverted, we keep the larger size.\n"; | ||
return true; | ||
} | ||
} |