Skip to content
This repository was archived by the owner on Feb 16, 2022. It is now read-only.

Commit b22341a

Browse files
committed
Merge branch 'release/v4.0.4'
2 parents 2383a17 + eb12dd7 commit b22341a

10 files changed

+30
-33
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
This project adheres to [Semantic Versioning](CONTRIBUTING.md).
66

77

8+
## [v4.0.4] - 2020-04-09
9+
- Tweak artisan command registration
10+
- Reverse commit "Convert database int fields into bigInteger"
11+
- Refactor publish command and allow multiple resource values
12+
813
## [v4.0.3] - 2020-04-04
914
- Fix namespace issue
1015

@@ -135,6 +140,7 @@ This project adheres to [Semantic Versioning](CONTRIBUTING.md).
135140
## v0.0.1 - 2017-04-08
136141
- Rename package to "rinvex/attributable" from "rinvex/sparse" based on 715a831
137142

143+
[v4.0.4]: https://github.com/rinvex/laravel-attributes/compare/v4.0.3...v4.0.4
138144
[v4.0.3]: https://github.com/rinvex/laravel-attributes/compare/v4.0.2...v4.0.3
139145
[v4.0.2]: https://github.com/rinvex/laravel-attributes/compare/v4.0.1...v4.0.2
140146
[v4.0.1]: https://github.com/rinvex/laravel-attributes/compare/v4.0.0...v4.0.1

database/migrations/2020_01_01_000001_create_attributes_table.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function up(): void
1717
{
1818
Schema::create(config('rinvex.attributes.tables.attributes'), function (Blueprint $table) {
1919
// Columns
20-
$table->bigIncrements('id');
20+
$table->increments('id');
2121
$table->string('slug');
2222
$table->{$this->jsonable()}('name');
2323
$table->{$this->jsonable()}('description')->nullable();

database/migrations/2020_01_01_000002_create_attribute_text_values_table.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ public function up(): void
1717
{
1818
Schema::create(config('rinvex.attributes.tables.attribute_text_values'), function (Blueprint $table) {
1919
// Columns
20-
$table->bigIncrements('id');
20+
$table->increments('id');
2121
$table->text('content');
22-
$table->bigInteger('attribute_id')->unsigned();
23-
$table->bigInteger('entity_id')->unsigned();
22+
$table->integer('attribute_id')->unsigned();
23+
$table->integer('entity_id')->unsigned();
2424
$table->string('entity_type');
2525
$table->timestamps();
2626

database/migrations/2020_01_01_000003_create_attribute_boolean_values_table.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ public function up(): void
1717
{
1818
Schema::create(config('rinvex.attributes.tables.attribute_boolean_values'), function (Blueprint $table) {
1919
// Columns
20-
$table->bigIncrements('id');
20+
$table->increments('id');
2121
$table->boolean('content');
22-
$table->bigInteger('attribute_id')->unsigned();
23-
$table->bigInteger('entity_id')->unsigned();
22+
$table->integer('attribute_id')->unsigned();
23+
$table->integer('entity_id')->unsigned();
2424
$table->string('entity_type');
2525
$table->timestamps();
2626

database/migrations/2020_01_01_000004_create_attribute_datetime_values_table.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ public function up(): void
1717
{
1818
Schema::create(config('rinvex.attributes.tables.attribute_datetime_values'), function (Blueprint $table) {
1919
// Columns
20-
$table->bigIncrements('id');
20+
$table->increments('id');
2121
$table->dateTime('content');
22-
$table->bigInteger('attribute_id')->unsigned();
23-
$table->bigInteger('entity_id')->unsigned();
22+
$table->integer('attribute_id')->unsigned();
23+
$table->integer('entity_id')->unsigned();
2424
$table->string('entity_type');
2525
$table->timestamps();
2626

database/migrations/2020_01_01_000005_create_attribute_integer_values_table.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ public function up(): void
1717
{
1818
Schema::create(config('rinvex.attributes.tables.attribute_integer_values'), function (Blueprint $table) {
1919
// Columns
20-
$table->bigIncrements('id');
21-
$table->bigInteger('content');
22-
$table->bigInteger('attribute_id')->unsigned();
23-
$table->bigInteger('entity_id')->unsigned();
20+
$table->increments('id');
21+
$table->integer('content');
22+
$table->integer('attribute_id')->unsigned();
23+
$table->integer('entity_id')->unsigned();
2424
$table->string('entity_type');
2525
$table->timestamps();
2626

database/migrations/2020_01_01_000006_create_attribute_varchar_values_table.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ public function up(): void
1717
{
1818
Schema::create(config('rinvex.attributes.tables.attribute_varchar_values'), function (Blueprint $table) {
1919
// Columns
20-
$table->bigIncrements('id');
20+
$table->increments('id');
2121
$table->string('content');
22-
$table->bigInteger('attribute_id')->unsigned();
23-
$table->bigInteger('entity_id')->unsigned();
22+
$table->integer('attribute_id')->unsigned();
23+
$table->integer('entity_id')->unsigned();
2424
$table->string('entity_type');
2525
$table->timestamps();
2626

database/migrations/2020_01_01_000007_create_attribute_entity_table.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ public function up(): void
1717
{
1818
Schema::create(config('rinvex.attributes.tables.attribute_entity'), function (Blueprint $table) {
1919
// Columns
20-
$table->bigInteger('attribute_id')->unsigned();
20+
$table->integer('attribute_id')->unsigned();
2121
$table->string('entity_type');
22-
$table->bigInteger('entity_id')->unsigned()->nullable(); // TODO: Making this nullable for now as it breaks the basic features
22+
$table->integer('entity_id')->unsigned()->nullable(); // TODO: Making this nullable for now as it breaks the basic features
2323
$table->timestamps();
2424

2525
// Indexes

src/Console/Commands/PublishCommand.php

+4-13
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class PublishCommand extends Command
1313
*
1414
* @var string
1515
*/
16-
protected $signature = 'rinvex:publish:attributes {--f|force : Overwrite any existing files.} {--r|resource=all}';
16+
protected $signature = 'rinvex:publish:attributes {--f|force : Overwrite any existing files.} {--r|resource=* : Specify which resources to publish.}';
1717

1818
/**
1919
* The console command description.
@@ -31,18 +31,9 @@ public function handle(): void
3131
{
3232
$this->alert($this->description);
3333

34-
switch ($this->option('resource')) {
35-
case 'config':
36-
$this->call('vendor:publish', ['--tag' => 'rinvex/attributes::config', '--force' => $this->option('force')]);
37-
break;
38-
case 'migrations':
39-
$this->call('vendor:publish', ['--tag' => 'rinvex/attributes::migrations', '--force' => $this->option('force')]);
40-
break;
41-
default:
42-
$this->call('vendor:publish', ['--tag' => 'rinvex/attributes::config', '--force' => $this->option('force')]);
43-
$this->call('vendor:publish', ['--tag' => 'rinvex/attributes::migrations', '--force' => $this->option('force')]);
44-
break;
45-
}
34+
collect($this->option('resource') ?: ['config', 'migrations'])->each(function ($resource) {
35+
$this->call('vendor:publish', ['--tag' => "rinvex/attributes::{$resource}", '--force' => $this->option('force')]);
36+
});
4637

4738
$this->line('');
4839
}

src/Providers/AttributesServiceProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function register()
4848
});
4949

5050
// Register console commands
51-
! $this->app->runningInConsole() || $this->registerCommands();
51+
$this->registerCommands();
5252
}
5353

5454
/**

0 commit comments

Comments
 (0)