Overview

Namespaces

  • None
  • Yajra
    • Oci8
      • Connectors
      • Eloquent
      • Query
        • Grammars
        • Processors
      • Schema
        • Grammars

Classes

  • Yajra\Oci8\Connectors\OracleConnector
  • Yajra\Oci8\Eloquent\OracleEloquent
  • Yajra\Oci8\Oci8Connection
  • Yajra\Oci8\Oci8ServiceProvider
  • Yajra\Oci8\Query\Grammars\OracleGrammar
  • Yajra\Oci8\Query\OracleBuilder
  • Yajra\Oci8\Query\Processors\OracleProcessor
  • Yajra\Oci8\Schema\Comment
  • Yajra\Oci8\Schema\Grammars\OracleGrammar
  • Yajra\Oci8\Schema\OracleAutoIncrementHelper
  • Yajra\Oci8\Schema\OracleBlueprint
  • Yajra\Oci8\Schema\OracleBuilder
  • Yajra\Oci8\Schema\Sequence
  • Yajra\Oci8\Schema\Trigger

Traits

  • Yajra\Oci8\OracleReservedWords

Functions

  • config_path
  • Overview
  • Namespace
  • Class
 1: <?php
 2: 
 3: namespace Yajra\Oci8\Schema;
 4: 
 5: use Illuminate\Database\Schema\Blueprint;
 6: 
 7: class OracleBlueprint extends Blueprint
 8: {
 9:     /**
10:      * Table comment.
11:      *
12:      * @var string
13:      */
14:     public $comment = null;
15: 
16:     /**
17:      * Column comments
18:      *
19:      * @var array
20:      */
21:     public $commentColumns = [];
22: 
23:     /**
24:      * Database prefix variable.
25:      *
26:      * @var string
27:      */
28:     protected $prefix;
29: 
30:     /**
31:      * Set table prefix settings.
32:      *
33:      * @param string $prefix
34:      */
35:     public function setTablePrefix($prefix = '')
36:     {
37:         $this->prefix = $prefix;
38:     }
39: 
40:     /**
41:      * Add creation and update timestampTz columns to the table.
42:      *
43:      * @return void
44:      */
45:     public function timestampsTz()
46:     {
47:         $this->timestampTz('created_at');
48: 
49:         $this->timestampTz('updated_at');
50:     }
51: 
52:     /**
53:      * Create a default index name for the table.
54:      *
55:      * @param  string $type
56:      * @param  array $columns
57:      * @return string
58:      */
59:     protected function createIndexName($type, array $columns)
60:     {
61:         $short_type = [
62:             'primary' => 'pk',
63:             'foreign' => 'fk',
64:             'unique'  => 'uk',
65:         ];
66: 
67:         $type = isset($short_type[$type]) ? $short_type[$type] : $type;
68: 
69:         $index = strtolower($this->prefix . $this->table . '_' . implode('_', $columns) . '_' . $type);
70: 
71:         // max index name length is 30 chars
72:         return substr(str_replace(['-', '.'], '_', $index), 0, 30);
73:     }
74: 
75:     /**
76:      * Create a new nvarchar2 column on the table.
77:      *
78:      * @param string $column
79:      * @param int $length
80:      * @return \Illuminate\Support\Fluent
81:      */
82:     public function nvarchar2($column, $length = 255)
83:     {
84:         return $this->addColumn('nvarchar2', $column, compact('length'));
85:     }
86: }
87: 
API documentation generated by ApiGen