mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
select only real tables (and not views) in mssql (#5816)
* select only real tables (and not views) in mssql * add table_catalog check * Add changeset Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
5
.changeset/eight-cups-thank.md
Normal file
5
.changeset/eight-cups-thank.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@directus/schema': patch
|
||||
---
|
||||
|
||||
Ignore views in schema overview for MS SQL Server
|
||||
@@ -29,6 +29,11 @@ export default class MSSQL extends KnexMSSQL implements SchemaInspector {
|
||||
ON [c].[TABLE_NAME] = [pk].[TABLE_NAME]
|
||||
AND [c].[TABLE_CATALOG] = [pk].[CONSTRAINT_CATALOG]
|
||||
AND [c].[COLUMN_NAME] = [pk].[COLUMN_NAME]
|
||||
INNER JOIN
|
||||
[${this.knex.client.database()}].INFORMATION_SCHEMA.TABLES as t
|
||||
ON [c].[TABLE_NAME] = [t].[TABLE_NAME]
|
||||
AND [c].[TABLE_CATALOG] = [t].[TABLE_CATALOG]
|
||||
AND [t].TABLE_TYPE = 'BASE TABLE'
|
||||
`
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user