Compare commits

...

3 commits

Author SHA1 Message Date
21d7bbf158
0.6.1 release
* Fix the ability to rollback migrations.
2024-07-10 16:41:54 +02:00
ba82668b76
Ensure emails entries are dropped when the related customer entry is deleted. 2024-07-10 16:36:35 +02:00
6e212c1513
Change the order of migrations 2024-07-10 16:19:55 +02:00
6 changed files with 51 additions and 2 deletions

View file

@ -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.

View file

@ -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

View file

@ -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": [

View file

@ -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']);
});
}
}

View file

@ -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;