Skip to content

Commit d7dc59d

Browse files
committed
Added pipeline order to models
1 parent 9fe49ad commit d7dc59d

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::table(config('laravel-crm.db_table_prefix').'quote_products', function (Blueprint $table) {
17+
$table->integer('pipeline_stage_order')->nullable()->after('pipeline_stage_id');
18+
});
19+
20+
Schema::table(config('laravel-crm.db_table_prefix').'order_products', function (Blueprint $table) {
21+
$table->integer('pipeline_stage_order')->nullable()->after('pipeline_stage_id');
22+
});
23+
24+
Schema::table(config('laravel-crm.db_table_prefix').'invoice_lines', function (Blueprint $table) {
25+
$table->integer('pipeline_stage_order')->nullable()->after('pipeline_stage_id');
26+
});
27+
28+
Schema::table(config('laravel-crm.db_table_prefix').'delivery_products', function (Blueprint $table) {
29+
$table->integer('pipeline_stage_order')->nullable()->after('pipeline_stage_id');
30+
});
31+
32+
Schema::table(config('laravel-crm.db_table_prefix').'purchase_order_lines', function (Blueprint $table) {
33+
$table->integer('pipeline_stage_order')->nullable()->after('pipeline_stage_id');
34+
});
35+
}
36+
37+
/**
38+
* Reverse the migrations.
39+
*
40+
* @return void
41+
*/
42+
public function down()
43+
{
44+
Schema::table(config('laravel-crm.db_table_prefix').'quote_products', function (Blueprint $table) {
45+
$table->dropColumn('pipeline_stage_order');
46+
});
47+
48+
Schema::table(config('laravel-crm.db_table_prefix').'order_products', function (Blueprint $table) {
49+
$table->dropColumn('pipeline_stage_order');
50+
});
51+
52+
Schema::table(config('laravel-crm.db_table_prefix').'invoice_lines', function (Blueprint $table) {
53+
$table->dropColumn('pipeline_stage_order');;
54+
});
55+
56+
Schema::table(config('laravel-crm.db_table_prefix').'delivery_products', function (Blueprint $table) {
57+
$table->dropColumn('pipeline_stage_order');
58+
});
59+
60+
Schema::table(config('laravel-crm.db_table_prefix').'purchase_order_lines', function (Blueprint $table) {
61+
$table->dropColumn('pipeline_stage_order');
62+
});
63+
}
64+
};

src/LaravelCrmServiceProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ function ($perPage = 30, $page = null, $options = []) {
471471
__DIR__ . '/../database/migrations/add_prefix_to_laravel_crm_leads_table.php.stub' => $this->getMigrationFileName($filesystem, 'add_prefix_to_laravel_crm_leads_table.php', 103),
472472
__DIR__ . '/../database/migrations/add_prefix_to_laravel_crm_deals_table.php.stub' => $this->getMigrationFileName($filesystem, 'add_prefix_to_laravel_crm_deals_table.php', 104),
473473
__DIR__ . '/../database/migrations/add_order_to_laravel_crm_items_tables.php.stub' => $this->getMigrationFileName($filesystem, 'add_order_to_laravel_crm_items_tables.php', 105),
474+
__DIR__ . '/../database/migrations/add_pipeline_order_to_laravel_crm_tables.php.stub' => $this->getMigrationFileName($filesystem, 'add_pipeline_order_to_laravel_crm_tables.php', 106),
474475
], 'migrations');
475476

476477
// Publishing the seeders

0 commit comments

Comments
 (0)