mirror of
https://github.com/immich-app/immich
synced 2026-08-29 13:15:45 +00:00
feat: sql-tools overrides (#19796)
This commit is contained in:
parent
1f9813a28e
commit
df4a27e8a7
114 changed files with 775 additions and 289 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { DatabaseReader } from 'src/sql-tools/types';
|
||||
import { Reader } from 'src/sql-tools/types';
|
||||
|
||||
export const readComments: DatabaseReader = async (schema, db) => {
|
||||
export const readComments: Reader = async (ctx, db) => {
|
||||
const comments = await db
|
||||
.selectFrom('pg_description as d')
|
||||
.innerJoin('pg_class as c', 'd.objoid', 'c.oid')
|
||||
|
|
@ -20,7 +20,7 @@ export const readComments: DatabaseReader = async (schema, db) => {
|
|||
|
||||
for (const comment of comments) {
|
||||
if (comment.object_type === 'r') {
|
||||
const table = schema.tables.find((table) => table.name === comment.object_name);
|
||||
const table = ctx.getTableByName(comment.object_name);
|
||||
if (!table) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue