Skip to content

Commit

Permalink
convert varchar 255 to text
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-adigital committed May 9, 2023
1 parent 38eb79a commit de170d8
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 1.0.8 - 2023-05-09
### Changed
### Fixed
- Fixed array null with $event
- Converted varchar 255 to text on plugin settings to prevent max length issue

## 1.0.7 - 2022-09-20
### Changed
Expand Down
2 changes: 1 addition & 1 deletion src/Eventbrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Eventbrite extends Plugin
*
* @var string
*/
public $schemaVersion = '1.0.0';
public $schemaVersion = '1.0.1';
public $hasCpSettings = true;
public $hasCpSection = true;

Expand Down
2 changes: 1 addition & 1 deletion src/migrations/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected function createTables() : bool
[
'id' => $this->primaryKey(),
// Custom columns in the table
'otherEventIds' => $this->string(255)->defaultValue(NULL),
'otherEventIds' => $this->text()->defaultValue(NULL),
// Default columns
'dateCreated' => $this->dateTime()->notNull(),
'dateUpdated' => $this->dateTime()->notNull(),
Expand Down
33 changes: 33 additions & 0 deletions src/migrations/m230509_135702_updateSettingsColumn.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace adigital\eventbrite\migrations;

use adigital\eventbrite\Eventbrite;

use adigital\eventbrite\records\NonAdminSettings;
use craft\db\Migration;

/**
* m230509_135702_updateSettingsColumn migration.
*/
class m230509_135702_updateSettingsColumn extends Migration
{
/**
* @inheritdoc
*/
public function safeUp()
{
// Place migration code here...
$this->alterColumn(NonAdminSettings::tableName(), 'otherEventIds', $this->text()->defaultValue(NULL));
return true;
}

/**
* @inheritdoc
*/
public function safeDown()
{
echo "m230509_135702_updateSettingsColumn cannot be reverted.\n";
return false;
}
}

0 comments on commit de170d8

Please sign in to comment.