Releases: umbrellio/laravel-pg-extensions
Releases · umbrellio/laravel-pg-extensions
Added PostgresTypeColumnAssertion
Moving helpers for assertions
Added support creating Exclude/Check constraints
Added support creating EXCLUDE/CHECK constraints (#23) EXCLUDE constraints https://www.postgresql.org/docs/9.0/sql-createtable.html#SQL-CREATETABLE-EXCLUDE Using the example below: Schema::create('table', function (Blueprint $table) { $table->integer('type_id'); $table->date('date_start'); $table->date('date_end'); $table->softDeletes(); $table ->exclude(['date_start', 'date_end']) ->using('type_id', '=') ->using('daterange(date_start, date_end)', '&&') ->method('gist') ->with('some_arg', 1) ->with('any_arg', 'some_value') ->whereNull('deleted_at'); }); An Exclude Constraint will be generated for your table: ALTER TABLE test_table ADD CONSTRAINT test_table_date_start_date_end_excl EXCLUDE USING gist (type_id WITH =, daterange(date_start, date_end) WITH &&) WITH (some_arg = 1, any_arg = 'some_value') WHERE ("deleted_at" is null) CHECK constraints https://www.postgresql.org/docs/9.4/ddl-constraints.html#DDL-CONSTRAINTS-CHECK-CONSTRAINTS Using the example below: Schema::create('table', function (Blueprint $table) { $table->integer('type_id'); $table->date('date_start'); $table->date('date_end'); $table ->check(['date_start', 'date_end']) ->whereColumn('date_end', '>', 'date_end') ->whereIn('type_id', [1, 2, 3]); }); An Check Constraint will be generated for your table: ALTER TABLE test_table ADD CONSTRAINT test_table_date_start_date_end_chk CHECK ("date_end" > "date_start" AND "type_id" IN [1, 2, 3])
Added support deleting UNIQUE partial indexes
Added support deleting UNIQUE partial indexes (#22) Added support for deleting unique indexes with WHERE conditions. By default, if the created unique index contains no conditions, PostgresSQL automatically creates a Constraint for it, for example: CREATE UNIQUE INDEX CONCURRENTLY examples_new_col_idx ON examples (new_col); ALTER TABLE examples ADD CONSTRAINT examples_unique_constraint USING INDEX examples_new_col_idx; If the unique index contains WHERE conditions, then such a Constraint will not be created, because PostgreSQL doesn't define a partial (ie conditional) UNIQUE constraint. When trying to delete such a partial unique index, we get the error "Unique Constraint not found", so the standard command to remove $table->dropUnique() does not fit, the command $table->dropIndex() is suitable, but if pass the array there, then the index name will be generated as for a regular index with the suffix _index, instead of _unique, which we need. And manually generating the index name is wrong. This Merge Request solves these problems.
Added supporting USING and Default Expressions to Schema.
Add supporting views to Blueprint/Schema
Add support views (#4) Adding support for creating views
Added to Schema supporting numeric types
Add numeric column type (#21) This PR adds numeric column type to schema builder. that. unlike 'decimal' type can be with variable precision
Fix Connection Refused by artisan package:discover --ansi
Moving register extensions to PostgresConnections (#19) Registration of user extensions is moved from UmbrellioPostgresProvider in PostgresConnection.
fix bug
Beta (Some fixes in tests)
2.2.2.2 tests fixes