You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php
+30Lines changed: 30 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -101,6 +101,23 @@ public function compileViews()
101
101
return"select viewname as name, schemaname as schema, definition from pg_views where schemaname not in ('pg_catalog', 'information_schema') order by viewname";
102
102
}
103
103
104
+
/**
105
+
* Compile the query to determine the user-defined types.
106
+
*
107
+
* @return string
108
+
*/
109
+
publicfunctioncompileTypes()
110
+
{
111
+
return'select t.typname as name, n.nspname as schema, t.typtype as type, t.typcategory as category, '
112
+
."((t.typinput = 'array_in'::regproc and t.typoutput = 'array_out'::regproc) or t.typtype = 'm') as implicit "
113
+
.'from pg_type t join pg_namespace n on n.oid = t.typnamespace '
114
+
.'left join pg_class c on c.oid = t.typrelid '
115
+
.'left join pg_type el on el.oid = t.typelem '
116
+
.'left join pg_class ce on ce.oid = el.typrelid '
117
+
."where ((t.typrelid = 0 and (ce.relkind = 'c' or ce.relkind is null)) or c.relkind = 'c') "
118
+
."and n.nspname not in ('pg_catalog', 'information_schema')";
119
+
}
120
+
104
121
/**
105
122
* Compile the SQL needed to retrieve all table names.
106
123
*
@@ -503,9 +520,22 @@ public function compileDropAllTypes($types)
503
520
return'drop type '.implode(',', $this->escapeNames($types)).' cascade';
0 commit comments