umbrellio / laravel-pg-extensions

Laravel extensions for Postgres
MIT License
92 stars 19 forks source link

Extending Schema for supporting triggers #6

Closed pvsaintpe closed 3 years ago

pvsaintpe commented 5 years ago

What parameters should be able to customize:

How it can be used:

Schema::table('table', function (Blueprint $table) {
   ...
   $table->createTrigger($name)
      ->before() // or ->after() // and by default 'BEFORE'
      ->event('INSERT') // or ->event(['INSERT', 'UPDATE']) // and by default INSERT
      ->language() // by default 'plpgsql'
      ->declare([
         'delta_time_key' => 'integer',
        'delta_amount_sold' => 'numeric(15,2)',
     ]) // and by default is empty []
     ->body($statement, $bindings = []) // and by default body is empty, $bindings is empty
  ;

});
github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days