Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
1 line
2.6 KiB
Plaintext
1 line
2.6 KiB
Plaintext
{"version":3,"sources":["../../src/postgres/init.ts"],"sourcesContent":["import type { Init } from 'payload'\n\nimport type { BasePostgresAdapter } from './types.js'\n\nimport { buildDrizzleRelations } from '../schema/buildDrizzleRelations.js'\nimport { buildRawSchema } from '../schema/buildRawSchema.js'\nimport { executeSchemaHooks } from '../utilities/executeSchemaHooks.js'\nimport { buildDrizzleTable } from './schema/buildDrizzleTable.js'\nimport { setColumnID } from './schema/setColumnID.js'\n\nexport const init: Init = async function init(this: BasePostgresAdapter) {\n this.rawRelations = {}\n this.rawTables = {}\n\n buildRawSchema({\n adapter: this,\n setColumnID,\n })\n\n await executeSchemaHooks({ type: 'beforeSchemaInit', adapter: this })\n\n if (this.payload.config.localization) {\n this.enums.enum__locales = this.pgSchema.enum(\n '_locales',\n this.payload.config.localization.locales.map(({ code }) => code) as [string, ...string[]],\n )\n }\n\n for (const tableName in this.rawTables) {\n buildDrizzleTable({ adapter: this, rawTable: this.rawTables[tableName] })\n }\n\n buildDrizzleRelations({\n adapter: this,\n })\n\n await executeSchemaHooks({ type: 'afterSchemaInit', adapter: this })\n\n this.schema = {\n pgSchema: this.pgSchema,\n ...this.tables,\n ...this.relations,\n ...this.enums,\n }\n}\n"],"names":["buildDrizzleRelations","buildRawSchema","executeSchemaHooks","buildDrizzleTable","setColumnID","init","rawRelations","rawTables","adapter","type","payload","config","localization","enums","enum__locales","pgSchema","enum","locales","map","code","tableName","rawTable","schema","tables","relations"],"mappings":"AAIA,SAASA,qBAAqB,QAAQ,qCAAoC;AAC1E,SAASC,cAAc,QAAQ,8BAA6B;AAC5D,SAASC,kBAAkB,QAAQ,qCAAoC;AACvE,SAASC,iBAAiB,QAAQ,gCAA+B;AACjE,SAASC,WAAW,QAAQ,0BAAyB;AAErD,OAAO,MAAMC,OAAa,eAAeA;IACvC,IAAI,CAACC,YAAY,GAAG,CAAC;IACrB,IAAI,CAACC,SAAS,GAAG,CAAC;IAElBN,eAAe;QACbO,SAAS,IAAI;QACbJ;IACF;IAEA,MAAMF,mBAAmB;QAAEO,MAAM;QAAoBD,SAAS,IAAI;IAAC;IAEnE,IAAI,IAAI,CAACE,OAAO,CAACC,MAAM,CAACC,YAAY,EAAE;QACpC,IAAI,CAACC,KAAK,CAACC,aAAa,GAAG,IAAI,CAACC,QAAQ,CAACC,IAAI,CAC3C,YACA,IAAI,CAACN,OAAO,CAACC,MAAM,CAACC,YAAY,CAACK,OAAO,CAACC,GAAG,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAKA;IAE/D;IAEA,IAAK,MAAMC,aAAa,IAAI,CAACb,SAAS,CAAE;QACtCJ,kBAAkB;YAAEK,SAAS,IAAI;YAAEa,UAAU,IAAI,CAACd,SAAS,CAACa,UAAU;QAAC;IACzE;IAEApB,sBAAsB;QACpBQ,SAAS,IAAI;IACf;IAEA,MAAMN,mBAAmB;QAAEO,MAAM;QAAmBD,SAAS,IAAI;IAAC;IAElE,IAAI,CAACc,MAAM,GAAG;QACZP,UAAU,IAAI,CAACA,QAAQ;QACvB,GAAG,IAAI,CAACQ,MAAM;QACd,GAAG,IAAI,CAACC,SAAS;QACjB,GAAG,IAAI,CAACX,KAAK;IACf;AACF,EAAC"} |