• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

umbrellio / laravel-pg-extensions / 311
100%

Build:
DEFAULT BRANCH: master
Ran 06 Aug 2019 08:32PM UTC
Jobs 7
Files 33
Run time 3min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
311

push

travis-ci

lazeevv
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])

74 of 74 new or added lines in 8 files covered. (100.0%)

307 of 307 relevant lines covered (100.0%)

86.21 hits per line

Jobs
ID Job ID Ran Files Coverage
2 311.2 (DB=pgsql POSTGRESQL_VERSION=9.2 COVERAGE=yes) 06 Aug 2019 08:32PM UTC 0
100.0
Travis Job 311.2
3 311.3 (DB=pgsql POSTGRESQL_VERSION=9.3 COVERAGE=yes) 06 Aug 2019 08:32PM UTC 0
100.0
Travis Job 311.3
4 311.4 (DB=pgsql POSTGRESQL_VERSION=9.4 COVERAGE=yes) 06 Aug 2019 08:32PM UTC 0
100.0
Travis Job 311.4
5 311.5 (DB=pgsql POSTGRESQL_VERSION=9.5 COVERAGE=yes) 06 Aug 2019 08:32PM UTC 0
100.0
Travis Job 311.5
6 311.6 (DB=pgsql POSTGRESQL_VERSION=9.6 COVERAGE=yes) 06 Aug 2019 08:35PM UTC 0
100.0
Travis Job 311.6
7 311.7 (DB=pgsql POSTGRESQL_VERSION=10.0 COVERAGE=yes) 06 Aug 2019 08:34PM UTC 0
100.0
Travis Job 311.7
8 311.8 (DB=pgsql DOCKER_POSTGRES=yes POSTGRESQL_VERSION=11.0 COVERAGE=yes) 06 Aug 2019 08:34PM UTC 0
100.0
Travis Job 311.8
Source Files on build 311
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #311
  • 3f8b253e on github
  • Prev Build on master (#305)
  • Next Build on master (#332)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc