already in progress:
SELECT C.column_name
, CAST((CASE WHEN C.column_name = TMP.column_name THEN 1 ELSE 0 END) AS BOOLEAN) AS IsPrimary
, CASE WHEN C.is_identity = 'YES' OR POSITION('NEXTVAL' IN UPPER(C.column_default)) >= 1 THEN
true
ELSE
false
END AS IsIdentity
, CAST(C.is_nullable AS BOOLEAN) AS IsNullable
, C.data_type AS DataType
, CASE WHEN C.column_default IS NOT NULL THEN
true
ELSE
false
END AS HasDefaultValue
FROM information_schema.columns C
LEFT JOIN
(
SELECT C.table_schema
, C.table_name
, C.column_name
, C.column_default
FROM information_schema.table_constraints TC
JOIN information_schema.constraint_column_usage AS CCU USING (constraint_schema, constraint_name)
JOIN information_schema.columns AS C ON C.table_schema = TC.constraint_schema
AND TC.table_name = C.table_name
AND CCU.column_name = C.column_name
WHERE TC.constraint_type = 'PRIMARY KEY'
) TMP ON TMP.table_schema = C.table_schema
AND TMP.table_name = C.table_name
AND TMP.column_name = C.column_name
WHERE C.table_name = @TableName
AND C.table_schema = @Schema;"
може постгресисти шось чули https://t.me/PostgresUkraine
Виявилось проблема в RepoDB
Дякую за посилання
https://github.com/mikependon/RepoDB/pull/1161
Обсуждают сегодня