Compare commits
3 commits
978a02c548
...
21d7bbf158
Author | SHA1 | Date | |
---|---|---|---|
21d7bbf158 | |||
ba82668b76 | |||
6e212c1513 |
6 changed files with 51 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
0.6.1
|
||||||
|
|
||||||
|
* Fix the ability to rollback migrations.
|
||||||
|
|
||||||
0.6.0
|
0.6.0
|
||||||
|
|
||||||
* Link to a Mailbox the Customers automatically created when fetching e-mails.
|
* Link to a Mailbox the Customers automatically created when fetching e-mails.
|
||||||
|
|
|
@ -19,7 +19,7 @@ You have been warned.
|
||||||
### Install the package with composer
|
### Install the package with composer
|
||||||
|
|
||||||
```
|
```
|
||||||
composer require "millions-missing-france/freescout-restricted-customers" "0.6.0"
|
composer require "millions-missing-france/freescout-restricted-customers" "0.6.1"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Edit the application routes
|
### Edit the application routes
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "millions-missing-france/freescout-restricted-customers",
|
"name": "millions-missing-france/freescout-restricted-customers",
|
||||||
"description": "Freescout restricted customers - Restrict access to Freescout customers to specific mailboxes",
|
"description": "Freescout restricted customers - Restrict access to Freescout customers to specific mailboxes",
|
||||||
"version": "0.6.0",
|
"version": "0.6.1",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"license": ["AGPL-3.0-only"],
|
"license": ["AGPL-3.0-only"],
|
||||||
"authors": [
|
"authors": [
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
<?php
|
||||||
|
/*
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
SPDX-FileCopyrightText: © 2024 Millions Missing FRANCE <info@millionsmissing.fr>
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Symfony\Component\Console\Output\ConsoleOutput;
|
||||||
|
use MillionsMissingFrance\FreescoutRestrictedCustomers\Customer;
|
||||||
|
|
||||||
|
class DropEmailsOnCustomersDeletion extends Migration {
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up() {
|
||||||
|
Schema::table('emails', function (Blueprint $table) {
|
||||||
|
// Ensure emails entries are dropped when the related customer entry is deleted.
|
||||||
|
$table
|
||||||
|
->foreign('customer_id')
|
||||||
|
->references('id')
|
||||||
|
->on('customers')
|
||||||
|
->onDelete('cascade');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down() {
|
||||||
|
Schema::table('emails', function (Blueprint $table) {
|
||||||
|
// Drop the foreign key constraint.
|
||||||
|
$table->dropForeign(['customer_id']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
SPDX-FileCopyrightText: © 2024 Millions Missing FRANCE <info@millionsmissing.fr>
|
||||||
|
*/
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
Loading…
Reference in a new issue