diff --git a/docs/database/postgres.mdx b/docs/database/postgres.mdx index d603814630..0501d0ad92 100644 --- a/docs/database/postgres.mdx +++ b/docs/database/postgres.mdx @@ -260,24 +260,26 @@ postgresAdapter({ beforeSchemaInit: [ ({ schema, adapter }) => { // Add a new table - schema.rawTables.myTable = { + adapter.rawTables.myTable = { name: 'my_table', - columns: [{ - name: 'my_id', - type: 'serial', - primaryKey: true - }], + columns: { + my_id: { + name: 'my_id', + type: 'serial', + primaryKey: true + } + } } // Add a new column to generated by Payload table: - schema.rawTables.posts.columns.customColumn = { + adapter.rawTables.posts.columns.customColumn = { name: 'custom_column', // Note that Payload SQL doesn't support everything that Drizzle does. type: 'integer', notNull: true } // Add a new index to generated by Payload table: - schema.rawTables.posts.indexes.customColumnIdx = { + adapter.rawTables.posts.indexes.customColumnIdx = { name: 'custom_column_idx', unique: true, on: ['custom_column'] diff --git a/docs/database/sqlite.mdx b/docs/database/sqlite.mdx index 18c4e9576d..cf1b3a3386 100644 --- a/docs/database/sqlite.mdx +++ b/docs/database/sqlite.mdx @@ -237,24 +237,26 @@ sqliteAdapter({ beforeSchemaInit: [ ({ schema, adapter }) => { // Add a new table - schema.rawTables.myTable = { + adapter.rawTables.myTable = { name: 'my_table', - columns: [{ - name: 'my_id', - type: 'integer', - primaryKey: true - }], + columns: { + my_id: { + name: 'my_id', + type: 'integer', + primaryKey: true + } + } } // Add a new column to generated by Payload table: - schema.rawTables.posts.columns.customColumn = { + adapter.rawTables.posts.columns.customColumn = { name: 'custom_column', // Note that Payload SQL doesn't support everything that Drizzle does. type: 'integer', notNull: true } // Add a new index to generated by Payload table: - schema.rawTables.posts.indexes.customColumnIdx = { + adapter.rawTables.posts.indexes.customColumnIdx = { name: 'custom_column_idx', unique: true, on: ['custom_column']