Files
klz-cables.com/.pnpm-store/v10/files/47/cca2ed32453143dcc1fec89904bc21f89b77664cc185119c1f83d7d00f67b2409f8675139ddbf4d8edeaa17674dc8412baf3b201972bdf7a73d7cea8c99d36
Marc Mintel 5397309103
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
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

42 lines
1.2 KiB
Plaintext

import { buildDrizzleRelations } from '../schema/buildDrizzleRelations.js';
import { buildRawSchema } from '../schema/buildRawSchema.js';
import { executeSchemaHooks } from '../utilities/executeSchemaHooks.js';
import { buildDrizzleTable } from './schema/buildDrizzleTable.js';
import { setColumnID } from './schema/setColumnID.js';
export const init = async function init() {
let locales;
this.rawRelations = {};
this.rawTables = {};
if (this.payload.config.localization) {
locales = this.payload.config.localization.locales.map(({ code })=>code);
}
const adapter = this;
buildRawSchema({
adapter,
setColumnID
});
await executeSchemaHooks({
type: 'beforeSchemaInit',
adapter: this
});
for(const tableName in this.rawTables){
buildDrizzleTable({
adapter,
locales,
rawTable: this.rawTables[tableName]
});
}
buildDrizzleRelations({
adapter
});
await executeSchemaHooks({
type: 'afterSchemaInit',
adapter: this
});
this.schema = {
...this.tables,
...this.relations
};
};
//# sourceMappingURL=init.js.map