Skip to content

Commit

Permalink
add optional migration to remove not needed tables + readme
Browse files Browse the repository at this point in the history
  • Loading branch information
eluhr committed Oct 18, 2024
1 parent f6cdef8 commit 6cc636a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ Module configuration
]
```

Upgrading
---

When upgrading von v2 to v3 run this migration: `yii migrate/up -p=@vendor/dmstr/yii2-resque-module/src/migrations/2.0-to-3.0`
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

use yii\db\Migration;

/**
* Handles the dropping of table `{{%queue_manager}}`.
*/
class m241018_114631_drop_queue_manager_table extends Migration
{
/**
* {@inheritdoc}
*/
public function up()
{
$tableName = '{{%queue_manager}}';
// Check if the table exists before dropping
if ($this->db->schema->getTableSchema($tableName, true) !== null) {
$this->dropTable($tableName);
}
}

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

0 comments on commit 6cc636a

Please sign in to comment.